Monday 26 August 2013

htaccess condition in 301

htaccess condition in 301

I am sure there are other threads on similar topics around the web. But I
just can't get this working on my own website. Please help me
My site working in my subdomain
for eg http://demo.example.com/sitename/india
if i am put 1 parameter like (india) only. its loading
profile.php?countryname=india also its working good.
But when i add multiple parameters into my url like this
http://demo.example.com/sitename/india/tamilnadu/chennai
i want load profile.php?countryname=india&state=tamilnadu&city=chennai .
I am try this code
RewriteCond %{HTTP_HOST} ^demo\.example\.com/sitename$
RewriteRule (.*) walola/$1/$2 [R=301,L]
RewriteRule ^([a-zA-Z0-9_-]+)$
sitename/profile.php?countryname=$1&state=$2 [QSA]
When i pass single parameter into my url its working otherwise its shows
404 error.
Please guide me.

No comments:

Post a Comment