I took the mod_rewrite approach, and it works flawlessly. One question I have, is that I often access the server via its IP instead of the canonical name. Is there a way to make apache use both domain.tld and its IP as the server name?
I've tried it with ServerAlias and it didn't make any difference, the only way I see of doing this would be duplicating the VirtualHost thats doing the redirecting and using the IP of the box as the server name. I'm pretty sure thats not a good idea though :p Scott. Scott Wilcox wrote: > AH. I'm a retard. > > Thanks Joshua :) > > Joshua Slive wrote: >> On 5/18/07, Scott Wilcox <[EMAIL PROTECTED]> wrote: >>> >>> Hey Joshua, >>> >>> I think I was a little ambiguous with what I said. It probably >>> would of >>> been better to explain it like this. >>> >>> If a VirtualHost is there for the requested URI, that is served. >>> For any requested URI (http://test1.com, http://sub.domain.com, >>> http://anything.anythingelse.anywhere.tld), then that >>> request is actually forwarded to the main site. >>> >>> At the moment, my first VirtualHost is catching everything and >>> displaying >>> the standard homepage fine, but i'd much prefer if they were pushed >>> over to >>> the correct URI. >> >> Did you read the link I sent? That is exactly what it does. >> >> As it says, the first <VirtualHost> is the default host which catches >> all names that don't match any other virtualhost. Put a Redirect in >> that host pointing to your "canonical" vhost (the "correct URI"), >> which should be contained in a separate <VirtualHost> section. >> >> Joshua. >> >> --------------------------------------------------------------------- >> The official User-To-User support forum of the Apache HTTP Server >> Project. >> See <URL:http://httpd.apache.org/userslist.html> for more info. >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> " from the digest: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.467 / Virus Database: 269.7.3/809 - Release Date: 17/05/2007 > 17:18 >