restrict htaccess access

Asked

Viewed 67 times

0

i have the following folder structure:

inserir a descrição da imagem aqui

I would like any external direct access done in helper and useful directory files to be forwarded to the index.html file that is at the root of the site.

That is, I want the only page that can be accessed directly (by an app on a smartphone) to be: /v1/index.php.

That kind of access I don’t want to happen: inserir a descrição da imagem aqui

And neither is this other:

inserir a descrição da imagem aqui

  • Look in the configuration files /etc/apache2/...conf see if there is (1) DirectoryIndex index.html index.php and (2) perhaps something like: Options +Indexes (that would be allowing to see the directories)

  • Are you using wamp or running on linux? If it is on linux, you can change the permissions of the folder to 700 for example, then the message "Forbiden" will appear. I don’t know if I can do it at wamp, because I only used it a few times.

1 answer

0

One of the options is to rewrite everything to v1/index.php

RewriteRule ^ v1/index.php [L]

And the other is to ban access:

RewriteRule ^(helper|uteis)/ - [F,L]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.