How to Remove php variable on redirect?

Discussion in 'Apache' started by ascensions, Sep 23, 2006.

  1. #1
    I apologize if this has been posted, but I can't find anything. I'll try to make it short and sweet:

    I've got an old blog at:

    website.com/blog/

    which has variables like:

    website.com/blog/?permalink=222

    currently I have the following redirect:

    RewriteRule ^blog/ http://website.com/ [R=301,L]

    which works, but also passes the variable through, but is no longer used causing multiple copies of the same page (for example:)

    website.com
    website.com/?permalink=222

    (so on and so forth)
    Is there a simple way in .htaccess to drop that variable?

    Thanks for your consideration & time.
     
    ascensions, Sep 23, 2006 IP
  2. ascensions

    ascensions Active Member

    Messages:
    175
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Never mind, figured it out... If anyone's interested:

    RewriteCond %{QUERY_STRING} permalink=([0-9]+)
    RewriteRule ^blog/$ http://website.com? [R=301,L]
     
    ascensions, Sep 23, 2006 IP