.htaccess redirect help

Discussion in 'Apache' started by pgiddy, May 21, 2007.

  1. #1
    I would like to take the traffic coming to this page:

    http://subdomain.domain.com/{keyword}

    and redirect it to:

    http://subdomain2.domain2.com/query?sub={keyword}

    I would like to be able to enter any keyword dynamically and have it redirect to the second domain with the same keyword. How can I configure .htaccess to get this to work?

    Thanks in advance. Positive reputation for anyone who helps. =)
     
    pgiddy, May 21, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    http:/subdomain.domain.com/.htaccess

    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^shop/(.*)$ http://subdomain2.domain2.com/query?sub=$1 [R=301,L]

    Why would you redirect from a search engine friendly URL to one search engines hate!
     
    Nintendo, May 21, 2007 IP