Mod_Rewrite Specific URL to Specific SubDomain

Discussion in 'Apache' started by atounia, Aug 27, 2007.

  1. #1
    How do I rewrite the following specific URL to the specific subdomain:

    From: http://www.domain.com/support.html
    To: http://support.domain.com

    Note: I just want "support.html" to rewrite to a subdomain. I don't want my other files such as "contact.html" or "aboutus.html" to rewrite to subdomains.

    Any help would greatly be appreciated. Thanks in advance.
     
    atounia, Aug 27, 2007 IP
  2. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try
    
    RewriteCond %{HTTP_HOST} www\.domain\.com
    RewriteRule ^support.html$ http://support.domain.com [R=301,L]
    
    Code (markup):
    that should work for you.
     
    powerspike, Aug 27, 2007 IP