Redirect Question

Discussion in 'Apache' started by adamwhiles, Oct 1, 2008.

  1. #1
    Currently I am using the following to redirect my site, note that the redirect does http://example.com/page1.html to http://example2.com/page1.html

    RewriteEngine On
     
    RewriteCond %{HTTP_HOST} ^.*example\.com$ [NC]
    RewriteRule ^(.*)$ http://example2.com/$1 [R=301,L]
    Code (markup):

    Basically my problem is that the subdomains like abc.example2.com get redirected to example2.com also.

    How can I fix this?

    Thanks!
     
    adamwhiles, Oct 1, 2008 IP
  2. HostPenguin

    HostPenguin Peon

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You may want to try removing the wildcard in front of the domain name.
     
    HostPenguin, Oct 1, 2008 IP
  3. adamwhiles

    adamwhiles Guest

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    sorry, i'm new to this. can you show me an example.
     
    adamwhiles, Oct 1, 2008 IP