Friday, 6 September 2013

URL Rewrite by .htaccess

URL Rewrite by .htaccess

I have 3 urls and i want to rewrite :
`health.php?news=apple` to `/health/news/apple`
health.php?info=apple to /health/info/apple
health.php?articles=apple to /health/articles/apple
for this i write below given code :
RewriteRule ^health health.php
RewriteRule health/news/(.*) /health.php?news=$1 [NC,QSA]
RewriteRule health/info/(.*) /health.php?info=$1 [NC,QSA]
RewriteRule health/articles/(.*) /health.php?articles=$1 [NC,QSA]
But this isn't working . Please help me.
Thanks in advance.

No comments:

Post a Comment