internetworkers AT lists.ibiblio.org
Subject: Internetworkers: http://www.ibiblio.org/internetworkers/
List archive
- From: Steven Champeon <schampeo AT hesketh.com>
- To: "Internetworkers: http://www.ibiblio.org/internetworkers/" <internetworkers AT lists.ibiblio.org>
- Subject: Re: [internetworkers] Apache httpd.conf help
- Date: Wed, 18 Feb 2004 11:37:44 -0500
on Wed, Feb 18, 2004 at 11:29:33AM -0500, Greg Cox wrote:
> > I want mydomain.org to be the primary domain. If anyone visits the site
> > by
> > typing mydomain.com or mydomain.net I want Apache to force a HTTP 301
> > redirect to mydomain.org.
>
> <VirtualHost *:80>
> ServerAdmin me AT mydomain.org
> DocumentRoot /var/www/tld/mydomain
> ServerName www.mydomain.org
> TransferLog logs/tld/mydomain_access_log
> ErrorLog logs/tld/mydomain_error_log
> </VirtualHost>
>
> <VirtualHost *:80>
> ServerName mydomain.org
> ServerAlias mydomain.net www.mydomain.net mydomain.com www.mydomain.com
> TransferLog logs/tld/mydomain_access_log
> ErrorLog logs/tld/mydomain_error_log
> RewriteEngine on
> RewriteRule ^/$ http://www.mydomain.org [R=301,L]
> RewriteRule ^/(.*) http://www.mydomain.org/$1 [R,L]
> <IfModule mod_userdir.c>
> UserDir disabled
> </IfModule>
> </VirtualHost>
Why use mod_rewrite for a simple redirect? Seems like a bit much.
<VirtualHost *:80>
ServerName mydomain.org
TransferLog logs/tld/mydomain_access_log
ErrorLog logs/tld/mydomain_error_log
RedirectMatch permanent ^/(.*) http://www.mydomain.org/$1
</VirtualHost>
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2
http://httpd.apache.org/docs/mod/mod_alias.html#redirectmatch
Steve,
who has an official craigslist pocket protector, lovingly machine crafted
in white vinyl.
--
hesketh.com/inc. v: (919) 834-2552 f: (919) 834-2554 w: http://hesketh.com
Book publishing is second only to furniture delivery in slowness. -b. schneier
-
[internetworkers] raleigh.craigslist.org?,
David R . Matusiak, 02/18/2004
-
Re: [internetworkers] raleigh.craigslist.org?,
Thomas Beckett, 02/18/2004
-
Re: [internetworkers] raleigh.craigslist.org?,
Paul Jones, 02/18/2004
-
[internetworkers] Apache httpd.conf help,
Tony Spencer, 02/18/2004
-
Re: [internetworkers] Apache httpd.conf help,
Greg Cox, 02/18/2004
- RE: [internetworkers] Apache httpd.conf help, Tony Spencer, 02/18/2004
- Re: [internetworkers] Apache httpd.conf help, Steven Champeon, 02/18/2004
-
Re: [internetworkers] Apache httpd.conf help,
Greg Cox, 02/18/2004
-
[internetworkers] Apache httpd.conf help,
Tony Spencer, 02/18/2004
-
Re: [internetworkers] raleigh.craigslist.org?,
Paul Jones, 02/18/2004
- Re: [internetworkers] raleigh.craigslist.org?, K. Jo Garner, 02/18/2004
-
Re: [internetworkers] raleigh.craigslist.org?,
Jeremy Portzer, 02/18/2004
- Re: [internetworkers] raleigh.craigslist.org?, Paul Jones, 02/18/2004
-
RE: [internetworkers] raleigh.craigslist.org?,
Scott Lundgren, 02/18/2004
- RE: [internetworkers] raleigh.craigslist.org?, Tony Spencer, 02/18/2004
-
Re: [internetworkers] raleigh.craigslist.org?,
Thomas Beckett, 02/18/2004
Archive powered by MHonArc 2.6.24.