Php – removing ? and = from php get method

.htaccessPHP

well wat im trying to do is to remove the Question mark from the url like, im using a form and the action of it is lets say city.php depending on wat u enter on the form the url will be like http://mysite/city.php?city=newyork the thing is how can i remove the question mark from the link using .htaccess

Best Answer

In your .htaccess file or virtual host configuration do something like this:

RewriteEngine On
RewriteRule ^city/(.*)$ /city.php?city=$1 [P]

This will transparently proxy requests from http://mysite/city/newyork to the server as http://mysite/city.php?city=newyork.

Related Topic