htaccess rewrite problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RayYates
    Developer Partner



    • Dec 2006
    • 1517

    #1

    htaccess rewrite problem

    I have the following redirects to get rid of some dead links showing up in search crawlers.

    RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [NC]
    RewriteCond %{QUERY_STRING} ^unsubscribe&group=128f987fbc$ [NC]
    RewriteRule ^scotmail/scotmail\.mvc$ http://www.mydomain.com [R=301,L]

    What I expected is this
    http://www.mydomain.com

    Unfortunately the query string is getting sent to the address bar.
    What I get is this


    What do I need to change?

    I thought I had to use [QSA] to get the query string output.
    Ray Yates
    "If I have seen further, it is by standing on the shoulders of giants."
    --- Sir Isaac Newton
  • ILoveHostasaurus
    Mega Mivite










    • Mar 2006
    • 4998

    #2
    You need a ? after the .com: .com? [R=301,L]

    If you redirect to a root then the browser throws the original query string back on again, the ? tells it to strip it.
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment

    • RayYates
      Developer Partner



      • Dec 2006
      • 1517

      #3
      Thank you sir.
      Ray Yates
      "If I have seen further, it is by standing on the shoulders of giants."
      --- Sir Isaac Newton

      Comment

      Working...
      X