php - Rewriting url in apache is not working -
i using following code in .htaccess direct editor in ipage server changing website's page url from
for example:
http://foodinger.in/viewrestaurant.php?raipur=barbecue-country&id=3006
to
http://foodinger.in/viewrestaurant/raipur/barbecue-country
but not working
rewriteengine on
rewriterule viewrestaurant/raipur/(.*)/ viewrestaurant.php?raipur=$1&id=$2
rewriterule viewrestaurant/raipur/(.*) viewrestaurant.php?raipur=$1&id=$2
am doing wrong, please suggest me right way if wrong ? in advance
you specify 1 group substitution (.*)
replace $1
in target url.
try:
rewriteengine on rewriterule "^/viewrestaurant/raipur/(.*)/(.*)/?" "/viewrestaurant.php?raipur=$1&id=$2"
and query id
: http://foodinger.in/viewrestaurant/raipur/barbecue-country/3006
Comments
Post a Comment