New domain and sub directory....

Discussion in 'Apache' started by nando, May 30, 2008.

  1. #1
    So I'm moving domains and I'd like everything forwarded to the new domain...

    In other words - I'd like old-domain.com/page.php > new-domain.com/page.php....

    Same thing for any sub directories - old-domain.com/sub/page.php > new-domain.com/sub/page.php....

    Never mind about the sub directory thing....

    I've seen it before, but I've come across different ways of doing it, I'm obviously looking for the best/right way to do it...

    Any and all help is appreciated..

    nando
     
    nando, May 30, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Something like this should work:

    RewriteEngine On
    RewriteRule ^/(.*)$ http://www\.new-domain\.com/$1 [R]
    Code (markup):
    in your .htaccess.

    Jay
     
    jayshah, May 31, 2008 IP
  3. sajidshabbir

    sajidshabbir Well-Known Member

    Messages:
    605
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #3
    i didn't understand that what you are asking ?
     
    sajidshabbir, May 31, 2008 IP