httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Isabelle Moullet" <>
Subject [users@httpd] Redirect directives inApache 2.0
Date Fri, 17 Sep 2004 10:22:30 GMT

We are using httpd-2.0.46-40.ent version of Apache on a Redhat Adv.
server 3.0. I got trouble using both Redirect and RewriteRule directive
with this configuration. 

Here is a excerpt of our conf files: 

CustomLog       /var/log/httpd/        combined
#CustomLog      "|/bin/grep -v '\" 302 ' >>
/var/log/httpd/" combined
ErrorLog   /var/log/httpd/

DocumentRoot    /var/www/vhosts/

ScriptAlias     /cgi    "/var/www/vhosts/"

# Redirect de la page chgt de password (ci)
 RedirectMatch   ^/ci/pass /ci/page2845_fr.html
#Redirect de HP vers un site jahia
RedirectMatch  ^/$ /central/page2192_fr.html
RedirectMatch   ^/mediation /central/page2916_fr.html
RedirectMatch   ^/annuaires /central/page5573_fr.html
RedirectMatch   ^/handicap  /central/page2568_fr.html
RedirectMatch   ^/amarillo  /central/page4715_fr.html
RedirectMatch   ^/nino      /central/page4721_fr.html
RedirectMatch   ^/bologne   /central/page5713_fr.html

Redirect  /toto 

RewriteEngine On
RewriteLog logs/jahia-rewrite
RewriteLogLevel 9

RewriteMap  JahiaMap prg:/etc/httpd/conf/map/
RewriteMap  ReverseJahiaMap prg:/etc/httpd/conf/map/

RewriteCond     ${ReverseJahiaMap:http:\/\/%{SERVER_NAME}}      !NULL
RewriteRule     ^/$
/Jahia/site/${ReverseJahiaMap:http://%{SERVER_NAME}}   [PT,QSA,L,NS]

#find in document root first
RewriteCond     %{REQUEST_URI}  !^/(Jahia|administration).*
RewriteCond             %{DOCUMENT_ROOT}%{REQUEST_URI}          !-d
RewriteCond             %{DOCUMENT_ROOT}%{REQUEST_URI}          -F
RewriteRule     ^(.*)   %{DOCUMENT_ROOT}$1      [L,NS]

#Find in tomcat webapps directory for unidoc
RewriteCond     %{REQUEST_URI}  !^/(Jahia|administration).*
RewriteCond             /var/tomcat4/webapps%{REQUEST_URI}
RewriteRule     ^(.*)   /var/tomcat4/webapps$1  [L,NS]

#Find in tomcat jahia directory
RewriteCond     %{REQUEST_URI}  !^/(Jahia|administration).*
RewriteCond             /var/tomcat4/jahia%{REQUEST_URI}
RewriteRule     ^(.*)   /var/tomcat4/jahia$1    [L,NS]

#Forward to gaia if not jahia site
RewriteCond     %{REQUEST_URI}  !^/(Jahia|administration|webdav|do).*
RewriteCond     %{REQUEST_URI}  ^/([^/]+)/?(.*)$
RewriteCond     ${ReverseJahiaMap:http:\/\/%{SERVER_NAME}\/%1|NULL}
#RewriteCond    ${JahiaMap:%1|NULL}     NULL
RewriteRule     ^(.*)$1   [R,L,NS]


All the rewriterule directives work fine but none of the Redirect
directives work. It looks like Redirect are simply ignored. I tried to
switch the order of the LoadModules doirectives for mod_alias and
mod_rewrite in the main server configuration without success.. 

The workaround I use now is to replace all Redirect directives with a
RewriteRule one. But not very satisfactory. 

I mention that the same configuration used to work perfectly with Apache

Thanks for any suggestion

Isabelle Moullet
Centre Informatique UNIL
College Propedeutique 2
CH 1015 Lausanne
Tel: +41 21 692 22 23
Help Desk du Centre informatique: Email:
(lundi au vendredi 8h30 - 17h00)    Tel:   021 692 22 11

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