rishibala143 Posted January 29, 2011 Share Posted January 29, 2011 Hi I am new to mod_rewrite I need two things to do in htacess 1. I want all my php pages to display as html Example : index.php to index.html aboutus.php to aboutus.html I given like this Options +FollowSymLinks RewriteEngine on RewriteRule ^([^/]*)\.html$ index.php?action=$1 RewriteRule ^([^/]*)\.html$ aboutus.php?action=$1 This works good. But for this a query string is passes. I don’t want to give any query string. If I click index.php it should redirect to index.html. I don’t want to write separate for aboutus.php. within a single code it should redirect all php to html pages 2. The most wanted thing I want to search a thing using city name in my project For example If I click the cityname eg.chennai The following url will be like this : www.domainname.com/search.php?city=chennai But I want like this http://chennai.domainname.com if I click Mumbai it should be http://mumbai.domainname.com How to do this ? I want like this site http://www.clickindia.com/ http://www.indialist.com There if we click the city name it will redirect the url as cityname.domainname.com Please help Link to comment https://forums.phpfreaks.com/topic/226027-urgent-mod_rewrite-help-for-redirecting-url-as-citynamemaindomaincom/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.