I want to rewrite these so that the text in the adress bar should be
mysite.com/citiname.html
I want to rewrite these so that the text in the adress bar should be
mysite.com/citiname.html
First, make sure you have mod_rewrite enabled in Apache. Also make sure that
AllowOverride All
is enabled in the conf file. Then create a .htaccess file with the following contents:
RewriteEngine On
RewriteRule ^city/([A-Za-z]+)\.html$ $1.html [L]
The first part of the RewriteRule is the pattern. If the URL matches that pattern, the rule is executed and redirected to the second part. The $1 represents the group matched by ([A-Za-z]+).
So /city/Amsterdam.html is rewritten to /Amsterdam.html
(Btw, I don't have an option to test it atm, it's what I remembered from the rules I wrote in the past)