httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Johnson <>
Subject Re: [users@httpd] mod_rewrite questions?
Date Thu, 11 Nov 2004 23:37:42 GMT
Hi Bagus,

Mod Rewrite would do the trick.

RewriteCond %{HTTP_HOST} ^$
Rewrite Rule ^(.*)$                   /bar$1

You need to enable the mod_rewrite module. My Apache 1.x is getting a 
little rusty but you'll need to make sure that you have both an 
AddModule and LoadModule line for the rewrite module.

Hope that this helps.


Bagus wrote:

> Hi, hopefully this will be simple.
> I have two virtual hosts pointing at the same directory root.
> They are for example
> and
> For various resaons I want all requests to to be 
> redirected to
> Is this a Mod Rewrite  issue?  What's the syntax that I'd use?
> Also, when I try putting various configuration bits into the virtual 
> host directive in my httpd.conf I get errors with apachectl configtest.
> ie adding this to a virtual host
> RewriteEngine on
> I get:
> Syntax error on line 401 of /usr/local/apache/conf/httpd.conf:
> Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a 
> module not included in the server configuration
> Is there more that I have to do to get this to work?
> Thanks for any help. 
> Bagus 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message