.htaccess - Search Results

Discussion in 'Apache' started by zEron, Sep 24, 2009.

  1. #1
    I need some help with the .htaccess


    I have many search engines pointing to and need to point to the root
    FROM
    http://yoursite.com/viewtopic.php?f=29&t=290&p=688
    TO
    http://yoursite.com

    I would like a rewrite rule to the ROOT.


    currently I have - not working
    # redirect all traffic to
    RewriteCond {HTTP_HOST} ^yoursite.com/viewtopic.php?f=29&t=290&p=688% [nc]
    RewriteRule {HTTP_HOST} http://yoursite\.com/public {REQUEST_URI} [R=permanent,L]
    Code (markup):
     
    zEron, Sep 24, 2009 IP
  2. zEron

    zEron Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    May have solved it....

    
    
    RewriteCond %{HTTP_HOST} ^domainname.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.domainname.com$
    RewriteRule ^viewtopic\/?(.*)$ "http\:\/\/domainname\.com\/public\/$1" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^domainname.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.domainname.com$
    RewriteRule ^viewtopic\.php\/?(.*)$ "http\:\/\/domainname\.com\/public\/$1" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^domainname.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.domainname.com$
    RewriteRule ^viewtopic\.php\/?(.*)$ "http\:\/\/domainname\.com\/public\/$1" [R=301,L]
    Code (markup):
     
    zEron, Sep 24, 2009 IP
  3. chadsmith

    chadsmith Peon

    Messages:
    82
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Just to make sure I read that clearly, they're linking to:

    http://yoursite.com/viewtopic.php?f=29&t=290&p=688

    and you want it to link to:

    http://yoursite.com/ ?

    If that's the case this should do the trick:

    RewriteCond %{QUERY_STRING} ^f=29&t=290&p=688$
    RewriteRule ^viewtopic\.php$ /? [R=301,L]
    Code (markup):
     
    chadsmith, Sep 24, 2009 IP
  4. zEron

    zEron Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    THIS GUY IS - GOLD!!!!

    you are a genius.

    thank you ... thank you.
     
    zEron, Sep 25, 2009 IP