I'm wondering how to make my URLs pretty and SEO friendly and also work with PHP code.
Currently everything works fine (for example example.com/test/ is fine and works).
However when I have error.php?id=404
, I want it to go to /error/404/
.
How do I do this?
My current .htaccess is...
RewriteCond /%{REQUEST_FILENAME} !-d
RewriteCond /%{REQUEST_FILENAME}.php -f
RewriteRule ^([a-zA-Z0-9_-\s]+)/$ /$1.php
Any help please?
You can choose to let the framework handle it, or your can read more about mod_rewrite here
EDIT:
the underscore in url is not SEO friendly