Writing clean URLS with 1 parameter that point to page.php

Viewed 56

I would like when visitors type http://localhost/mywebsite/paris/ it calls http://localhost/mywebsite/page.php?city=paris

But when typed http://localhost/mywebsite/ it calls to http://localhost/mywebsite/index.php

RewriteEngine On
RewriteRule ([a-zA-Z-]*) /page.php?city=$1 [QSA,L]

I get the following error :

Not Found
The requested URL was not found on this server.
1 Answers
RewriteRule ^([a-zA-Z0-9]+)$ page.php?city=$1
RewriteRule ^([a-zA-Z0-9]+)/$ page.php?city=$1

Related