I want to create friendly url from
http://localhost/shop/categories.php?cat=asd --> http://localhost/shop/category/asd
but i always get Object not found
Error 404 error from apache.
.htaccess:
RewriteEngine On
RewriteRule ^.+category/([a-zA-Z]+)$ /shop/categories.php?cat=$1 [QSA,L,NE]
categories.php
<?php
echo $_GET["cat"];
?>
Tested with https://htaccess.madewithlove.be/
Output url: http://localhost/shop/categories.php?cat=asd (this url is working)
I've only 2 files in the folder shop:
Path:
C:\xampp\htdocs\shop
Files:
- .htaccess
- categories.php
More info:
- mod_rewrite loaded (checked in phpinfo and httpd.conf)
- AllowOverride All in httpd.conf and httpd.xampp.conf