Site Domain Redirection

Discussion in 'PHP' started by romeo2010, Apr 10, 2008.

  1. #1
    How can i redirect using .htacess or any other method to another domain


    here is example of what i need


    www.domain.com/blalba/music.html

    redirect

    www.domainnumber2.in/blalba/music.html
    basically

    anything from first domain goes to the second domain nothing changes in term of directory or pages.. only the domain



    so basically all the links from main domain goes to the second domain...


    the resean of doing this its because...on the first domain adsense is block... thats why i need to send the user to second domain so i can run the adsense...
     
    romeo2010, Apr 10, 2008 IP
  2. tigrrra

    tigrrra Well-Known Member

    Messages:
    2,109
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    120
    #2
    i think you add this to your .htacess
    "Redirect /blalba/music.html www.domainnumber2.in/blalba/music.html"

    that should do it
     
    tigrrra, Apr 10, 2008 IP
  3. romeo2010

    romeo2010 Peon

    Messages:
    183
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i am talking about full domain... not only one page


    doesn't matter what is the pages.. it will just redirect the domain
     
    romeo2010, Apr 10, 2008 IP
  4. c4st

    c4st Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    RewriteEngine On
    RewriteRule ^(.*)$ http://domainnumber2.in/$1 [R=301,L]
    Code (markup):
     
    c4st, Apr 10, 2008 IP
  5. romeo2010

    romeo2010 Peon

    Messages:
    183
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5


    will that work also if
    i add domain1 into domain2 hosting acount as domain pointer?

    then add the httacess of domain 2 the given code?
     
    romeo2010, Apr 10, 2008 IP