Need Help about domain redirect

Discussion in 'Programming' started by notion6782, Sep 23, 2012.

  1. #1
    Hi guys i have a problem with redirect
    Take www.abc.com
    for example. here is the www.abc.com/i-love-yahoo.html
    and i have another domain www.cde.com
    here is the problem:
    how can i do some redirect setting if i type www.cde.com/i-love-yahoo.html and then it shows the same content from www.abc.com/i-love-yahoo.html everything is the same but the different root domain.
    how to set it?
    thank you!
     
    notion6782, Sep 23, 2012 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    therefor you need scripting :) you could check the current domain against the data in the database and if it should be on another domain redirect the page before displaying anything to the user.
     
    EricBruggema, Sep 23, 2012 IP
  3. WeddiGo

    WeddiGo Greenhorn

    Messages:
    40
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    18
    #3
    You have many options depending on how what your websites are doing:

    1. if abc.com and cde.com is the same website but you want to keep cde.com visible as the address then (depending on your domain registrar) you can use something called "masked domain forwarding" where if someone types www.cde.com they will be effectively redirected to www.abc.com but the browser will show www.cde.com

    2
    . you can have a blank page "i-love-yahoo.html" on cde.com that redirects to www.abc.com/i-love-yahoo.html, for that all you need to do is to put the following somewhere in the blank page
    
    <script>
    location.href='http://[URL="http://www.abc.com/i-love-yahoo.html"]www.abc.com/i-love-yahoo.html[/URL]';
    </script>
    
    Code (markup):
    3. you can have a customised 404.html page (that's the "page not found") set on your server so when someone tries to go to 'http://www.cde.com/i-love-yahoo.html' and that page doesn't exist they get the custom 404.html which then using either server side or javascript code checks what was the page they wanted and redirects to abc.com to that page.
     
    WeddiGo, Sep 30, 2012 IP