I’ve created a php website and would like to make my content more search engine friendly. I’ve been experimenting with mod rewrite rules in .htaccess, which I’m completely new to and don’t seem to be able to get it to work.
My current urls are similar to http://www.example.com/maps/country.php?country=acountry
I would like to rewrite this to http://www.example.com/maps/country/acountry
I’ve tried a few things similar to this but cannot get it to work and just receive a 404 error:
RewriteRule ^country/([^/]*)$ /country.php?country=$1 [L,NC]
Any help greatly appreciated!
Tried multiple different ways, but cant’t get it to work
thomas lee is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.