The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

PHP redirect dependent on domain

  • # June 10, 2009 at 9:56 am

    I got a GoDaddy hosting account, the economy plan to save money. But you can only add domains to point to the root. How would I create a php script that would for example go:

    IF domain is "" GOTO "../php"
    IF domain is "" GOTO "../som"

    Any ideas?

    # June 10, 2009 at 11:09 am

    I’ve had a go at this myself. This will work correctly, right?

    < ?php if( $_SERVER['HTTP_HOST'] == '') { header( 'Location: ../new' ); } elseif( $_SERVER['HTTP_HOST'] == '') { header( 'Location: ../old' ); } ?>
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed