how-to alter .htaacess to handle subdomains properly.

Discussion in 'Apache' started by SaN-DeeP, Sep 1, 2005.

  1. #1
    Hi,
    I am currently running couple of sub-domains via our main domain: http://www.techarena.in

    Here are the sub-domains in use:
    http://forums.techarena.in
    http://gallery.techarena.in

    This is the .hta code used currently:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^207\.58\.143\.178$
    RewriteRule ^/?(.*)$ http://www.techarena.in/$1 [R=301,L,NS]
    
    ErrorDocument 400 /
    ErrorDocument 401 /
    ErrorDocument 403 /
    ErrorDocument 404 /
    ErrorDocument 500 /
    Code (markup):
    I am re-directing all the traffic from our Domain IP to domain via above code, and also re-directing all the 404 and/or error pages to respective portal.

    I want to acheive following things:
    I want to re-direct all the traffic coming from www.techarena.in/forums/ to http://forums.techarena.in

    and re-direct all the traffic coming from www.techarena.in/gallery/ to http://gallery.techarena.in

    I have many threads indexed in this fashion on google and yahoo as well:
    http://www.techarena.in/forums/showthread.php?t=346155

    The above url should be re-directed appropriately to http://forums.techarena.in/showthread.php?t=346155

    Thanks in advance for your help.

    Regards,
    SaN-DeeP
     
    SaN-DeeP, Sep 1, 2005 IP
  2. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #2
    sorry cant help ya, but incase ya havnt noticed you made a typo its .htaccess not .htaaccess ;)
     
    just-4-teens, Sep 1, 2005 IP
  3. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #3
    And you started two separate threads to post this...
     
    minstrel, Sep 3, 2005 IP