I have PHP project on localhost using XAMPP and also .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /locations/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /test.php [L]
</IfModule>
But this is not working and I am only getting Error 404. In httpd.conf file I have uncommented this line:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
I am using Windows 8.1. What can I do to make it work, please?
Improper syntax being used It is quite common for a syntax error to be the reason for an . htaccess file not working. If you are familiar with how to read and configure . htaccess rules, double check your configuration.
Resolve Apache port conflicts by changing your listening port to 8080. Include the listening port in the address when accessing localhost. Change your MySQL port to 3307 if another application is blocking the default port 3306.
htaccess file is usually present in your C:/xampp/htdocs/wordpress if you are in windows or /opt/lampp/htdocs/wordpress if you are on linux or mac if you can't find it simply... ( for Windows ) enable show hidden files in file manager...
You can use this rule in root .htaccess:
RewriteEngine On
RewriteBase /
RewriteRule ^locations(/.*)?$ test.php [L,NC]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With