Results 1 to 4 of 4
  1. #1

    redirection question

    I'm still a newbie with redirection of domains, I would need some help:

    I have a php website with 2 domains

    the content of the site is exactly the same for both but the entry page should be different according to the domain

    How can I do such a thing ?

    Is it possible to have an "index.php" entry page for one domain and a "index2.php" page for the other one ?

    Is this something I have to do in my php code or is it a server setting ??

    Thank you very much for helping

  2. #2
    Redirection is not a good thing for your purpose - make mirror sites. But if you want only redirection - use <meta> or php of JavaScript.

  3. #3
    Join Date
    Sep 2003

    It depends on how you go about it and the control panel your hosting provider offers.

    Generally if you have one hosting plan but have added two domains to it, then one of them will be a 'master' domain, and the other will be an add-on. The add-on will have its own folder and you would place all its files at that file. So you'll have to add a copy of all the files in that file.

    The other method is to as you said before, create an index2.php, however, you'll have to set-up forwarding so the domain goes to index2.php. By default it won't go to index2.php. In CPanel, when you create an add-on domain, it will automatically create a subdomain, so the add-on domain will point to the subdomain. You can change the subdomain to point to a different location, for example index2.php.

    InnoHosting, Performance Web Hosting || US: 1-888-522-INNO UK: 0800 612 8075
    Web Hosting - Virtual Servers - Managed Servers - Application Hosting
    Reseller Hosting with WHMCS & Preloaded KB | SSL | activGuard | End User Support
    LiteSpeed / CloudLinux / Idera Backups / True 24x7 Support / 10+ Years in Business

  4. #4
    Thanks for your replies

    I don't really get the difference between "parked" domains, "mirror" site and "addon" domain (in cpannel settings)

    I thought of doing a redirection page like this:

    PHP Code:
    if ( location.hostname == "" ) { 
    window.location "/users/domain_one/"
    } else if ( 
    location.hostname == "" ) { 
    window.location "/users/domain_two/"
    } else { 
    // build current content 

    isn't it a good idea ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts