httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Johnson <pe...@wizardslair.net>
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} ^www.bar.com$
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.

PJ

Bagus wrote:

>  
> Hi, hopefully this will be simple.
>  
> I have two virtual hosts pointing at the same directory root.
>  
> They are for example
>  
> http://www.foo.com and http://www.bar.com
>  
> For various resaons I want all requests to http://www.bar.com to be 
> redirected to http://www.bar.com/bar/
>  
> 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:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message