Redirect, index.php


#1

Hi -

I would like to set up my Dreamhost website to redirect to a different site IF the user points to the root of the website, but allow users to browse subdirectories. It looks like the panel redirect does not allow that. I tried setting up an index.php like this:

<?php header('Location: http://greenfoothills.org') ?>

and that doesn’t work. Any suggestions?

Thanks for your help.

-Terre


#2

You can also use an .htaccess file with this:

RedirectMatch ^/$ http://greenfoothills.org/

But you might want to login to shell /w SSH and use nano to make the file if you are using Windows (CRLF linebreaks will cause it not to work)