Skip to Content.
Sympa Menu

internetworkers - Re: [internetworkers] Apache httpd.conf help

internetworkers AT lists.ibiblio.org

Subject: Internetworkers: http://www.ibiblio.org/internetworkers/

List archive

Chronological Thread  
  • From: Greg Cox <glcox AT pobox.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:29:33 -0500 (EST)

> 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>






Archive powered by MHonArc 2.6.24.

Top of Page