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

63 Views Asked by At

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

There are 1 best solutions below

1
Albuquerque Web Design On
RewriteRule ^([a-zA-Z0-9]+)$ page.php?city=$1
RewriteRule ^([a-zA-Z0-9]+)/$ page.php?city=$1