I want to restrict the access to my directory (and redirect to my index.php) but it is not working well. When i change the extension from PHP to HTML it works fine, but I cannot make it work for php
This is what I have in my .htaccess:
Options All -Indexes
<files .htaccess>
order allow,deny
deny from all
</files>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L,QSA]
I'm new to all of this, so I really don't know how to solve this.
Thanks!
apachectl -M
, and look forrewrite_module (shared)
. If mod_rewrite is not enabled then you can enable it by addingLoadModule rewrite_module modules/mod_rewrite.so
in your httpd.conf file.C:\Program Files (x86)\Apache Group\Apache2\conf
orC:\Program Files\Apache Group\Apache2\conf
directory.httpd.conf
this line:#LoadModule rewrite_module modules/mod_rewrite.so
. I removed the # and retried, but it doesn't did anything