Announcement

Collapse
No announcement yet.

htaccess rewrite problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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
    http://www.adomain.com/?unsubscribe&group=128f987fbc

    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

    #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


      #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