Does .htaccess only effect the directory you upload it to?

Discussion in 'Apache' started by Monks, Apr 18, 2008.

  1. #1
    I would like to transfer my /blog/ directory to a new domain and the rest of the site to another new domain. Is it possible to upload different .htaccess so the redirects go to different domains?
     
    Monks, Apr 18, 2008 IP
  2. Monks

    Monks Well-Known Member

    Messages:
    193
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Should I have said please? :)

    If anyone has any insight for me, it would be greatly appreciated.
     
    Monks, Apr 19, 2008 IP
  3. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #3
    Does this make any sense ?

    It's designed to be uploaded to the root directory of the site, if it looks like the blog has been requested it goes one direction, otherwise it goes the other.

    RewriteEngine On
    RewriteRule ^/?blog(/.*)$ http://blog-site.com$1 [R=301,QSA,L]
    RewriteRule (.*) http://other-site.com/$1 [R=301,QSA,L]
    Code (markup):
     
    joebert, Apr 21, 2008 IP