[Cialug] HTTP forwarding/proxying-ish something

David Champion dchampion at visionary.com
Mon Jul 7 13:17:14 CDT 2008


Colin Burnett wrote:
> On Mon, Jul 7, 2008 at 9:23 AM, chris <chris at ia.gov> wrote:
>   
>> No need to use mod_rewrite for a simple redirect unless you are doing this
>> within an .htaccess file and it appears you
>> are not.
>>
>> This will work (uses mod_alias) and has *way* less overhead than firing up
>> the rewrite engine:
>>
>> <VirtualHost *:80>
>> ~  ServerName foo.com
>> ~  Redirect 301 / http://www.foo.com/
>> </VirtualHost>
>>     
>
> That's the kind of "trick" I was looking for.  I knew rewrite could do
> it but it seemed like a sledge hammer to kill a flea.
>
>
> Colin
>   

You can also do something different with the ServerName / ServerAlias 
directives, i.e.

ServerName foo.com
ServerAlias www.foo.com

This doesn't redirect, but it lets either name work for the site.

-dc




More information about the Cialug mailing list