URL rewritten but still the original one also works and not redirecting..

Discussion in 'Apache' started by ameerulislam43, May 13, 2014.

  1. #1
    RewriteRule ^massaggi-([^/]*)$ /an.php?prov=$1 [L]
    Code (markup):
    with a code like this I can see the links like this created

    website.com/massaggi-city

    But I can see that I can still access pages like

    website.com/an.php?prov=city

    I want to this (website.com/an.php?prov=city) to redirect to (website.com/massaggi-city)

    Any help highly appreciated.
     
    ameerulislam43, May 13, 2014 IP
  2. Shagoon

    Shagoon Notable Member

    Messages:
    596
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    220
    #2
    This should do the trick, I haven't tested it though:
    RewriteRule ^an.php?prov=([^/]*)$ /massaggi-$1  [R=301,L]
    Code (markup):
    Along side your rule.
     
    Shagoon, May 16, 2014 IP