httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nate" <nate.li...@tbh.info>
Subject Rewriting a URL
Date Mon, 03 Jun 2002 16:54:27 GMT
I currently run Redhat 7.2 with Apache 1.3.22. Mod_Rewrite is installed.

Scenario: I want to be able to take a name-based virtual host and point
multiple domains to it, but have all domains be rewritten as the primary
domain. (ie. say I have www.domain.com, www.domain.org, www.domain.net, if I
type those into my browser, I want all of them to be rewritten as
www.domain.com).

I tried the following:

<snip>
ServerName www.domain.com
DocumentRoot /wwwroot/domain1
ServerAlias www.domain.org
RewriteEngine on
RewriteCond %{HTTP_HOST}                !^www.domain.org(:80)?$
RewriteRule ^/(.*)                      http://www.domain.com/$1 [L,R]
RewriteOptions inherit
<snip>

The problem is that I don't completely understand the expressions, and the
info I have found on various sites just don't seem to explain it so it
clicks. Is there a simpler way to say something like "take all domains/hosts
that are aliased to this virtual host and re-write them as www.domain.com" ?

Could anyone point me in the right direction? Should I even be using
mod_rewrite? Ack!  =)

Nate D.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message