MySpaza - How To
Web Design Tips and PC and Linux Related Information

Subscribe
 



    follow me on Twitter

    Auto redirect users by domain - PHP / JavaScript
    auto redirect users by domain name php and javascript

    Added: 2008-01-06 00:48:18

    This script is useful for anyone wishing to redirect users depending on what domain name they have typed into the address bar. This will allow you to have multiple domain names on one server.

    <?
    if( $_SERVER['SERVER_NAME'] == 'yourdomain.com' )
    { echo('<title>Title of your website</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="pragma" content="no-cache">
    </head>

    <body><script language="javascript">
    <!--

    location.replace("http://yourdomain.com/homefolder/");

    -->
    </script><noscript><p>&nbsp;</p><p align=center>Your browser appears not support java script, please
    <a href="
    http://yourdomain.com/homefolder/index.php">CLICK HERE</a> to continue to <a href="http://yourdomain.com/homefolder/index.php">Your Website Name</a> </p></noscript><!--

    Script developed by Silverside.Co.Uk - You may use this script however your please.

    Out of courtesy please leave this comment intact.


    // -->'); } ?>

    Click to Download this Script

    Enjoy!




    Add a comment to this post
    Email confirmation is required for each post

    Name:
    Email:
    Comment:
     

    Comments from other users:




    Copyright MySpaza.Co.Uk - 2010