[Nepal] Rewrite rule not working

Bernie Innocenti bernie at codewiz.org
Mon Sep 15 05:55:10 EDT 2008


Bryan Berry wrote:
> Hey Bernie,
> 
> I am trying to create an Apache Rewrite Rule for
> pustakalaya.olenepal.org 
> 
> I just registered http://www.pustakalaya.org and I want to reroute it to
> pustakalaya.olenepal.org for the time being.
> 
> Here is the text in my apache2.conf file
> 
> RewriteEngine on
> RewriteLog /var/log/apache2/rewrite.log
> RewriteLogLevel 0 
> RewriteRule http://(.*)%{SERVER_NAME}\.org/?$
> http://pustakalaya.olenepal.org
> 
> This works for http://pustakalaya.org but not http://www.pustakalaya.org
> which keeps routing to the mirror.olenepal.org home page.
> 
> Do you have any idea why? I remember you saying that the virtual hosts
> set up on pustakalaya causes some weird issues.

The regex seems ok.  Does the RewriteRule appear inside a VirtualHost 
block?  Perhaps it needs to be repeated in each virtual host?

-- 
    \___/  Bernie Innocenti - http://www.codewiz.org/
   _| X |  Sugar Labs Team  - http://www.sugarlabs.org/
   \|_O_|  "It's an education project, not a laptop project!"


More information about the Nepal mailing list