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: "Tony Spencer" <tony AT tonyspencer.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:32:05 -0500

Excellent. I hadn't thought of mod_rewrite to solve the problem.

Thanks!

> -----Original Message-----
> From: internetworkers-bounces AT lists.ibiblio.org
> [mailto:internetworkers-bounces AT lists.ibiblio.org] On Behalf
> Of Greg Cox
> Sent: Wednesday, February 18, 2004 11:30 AM
> To: Internetworkers: http://www.ibiblio.org/internetworkers/
> Subject: Re: [internetworkers] Apache httpd.conf help
>
> > 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>
>
>
> ---
> Come and play at the InterNetWorkers Web site!
> http://www.ibiblio.org/internetworkers/
> You are currently subscribed to InterNetWorkers mailing list
> To unsubscribe visit
> http://lists.ibiblio.org/mailman/listinfo/internetworkers
>
>





Archive powered by MHonArc 2.6.24.

Top of Page