Saturday, March 17, 2012

how to modify php site url with htaccess

0
I am using some url like -
www.mydomain.com/index.php?page=about_us


I want it to look like -
www.mydomain.com/about_us


or


www.mydomain.com/page/about_us


How can I do this with htaccess?

Answer:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?page=$1 [L]

No comments :

Post a Comment