LaunchNess Monster

So you’ve had a temporary sign-up page out there for a couple months and you’ve been testing the site proper on a secret, password-protected subdomain. Now you’re ready to make sure everything works in situ before opening it up to the world. Use this handy mod_rewrite rule to redirect everyone but you to a temporary directory until everything is perfect.

The Switch

First things first, move or copy your sign-up form and all support files into the new temporary directory. I use /ingsoon/ which uses the TLD to spell out “Coming Soon.” Make sure to update any non-relative paths that may have changed including paths to stylesheets, images and JavaScript.

Next add the following to an .htaccess file in /ingsoon/ and any other directory that you want to remain accessible to others (eg. your Mint installation):

<IfModule mod_rewrite.c>
    RewriteEngine   off

Then add the following to your root .htaccess file, changing the IP address to your own (don’t forget to escape the dots with a backslash):

<IfModule mod_rewrite.c>
    RewriteEngine   on

    # Coming Soon redirect
    RewriteCond     %{REMOTE_ADDR}      !^(192\.168\.1\.101)$
    RewriteRule     .* /ingsoon/ [R,L]

Lastly, update your Campaign Monitor settings to reflect the new path. Go to “Manage Subscribers,” then click on the list associated with your sign-up form. In the sidebar under “Capturing and Processing” you need to update the path in both “Customize subscribe process” and “Unsubscribe settings.”

Now get back to work, you’re so close!

Sweet Mac Setup
Fever: Black, White and Read Hot All Over
Shaun Inman
June 15th, 2009 at 7:42 am