How to redirect all domains to a single domain?

Discussion in 'PHP' started by Mark_Anthony, Dec 29, 2010.

  1. #1
    I got 4 domains i want to redirect them all to a single domain.
    Because they all use the same CMS (same files)

    if there anyway in htaccess so i redirect them all to a single domain?
     
    Mark_Anthony, Dec 29, 2010 IP
  2. Kyosys

    Kyosys Peon

    Messages:
    226
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yup. Look into mod_rewrite.
     
    Kyosys, Dec 29, 2010 IP
  3. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #3
    It would be just as easy to forward your domains, most hosts provide this service free of charge, which means you don't need to purchase hosting for a .htaccess file.

    If your keen on using .htaccess there's a Similar Thread at the bottom of this page explaining how its done.
     
    MyVodaFone, Dec 29, 2010 IP
  4. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #4
    1. Change name servers for domains to point to the original domain.
    2. Use domain forwarding.
     
    mastermunj, Dec 29, 2010 IP
  5. marshall26

    marshall26 Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I prefer .htaccess in the root of each domain

    RewriteEngine on
    RewriteRule (.*) http://www.newsite.com/$1 [R=301,L] 
    PHP:
     
    marshall26, Dec 29, 2010 IP