You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Isabelle Moullet <Is...@ci.unil.ch> on 2004/09/17 12:22:30 UTC
[users@httpd] Redirect directives inApache 2.0
Bonjour,
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:
*************************************************
<VirtualHost wwwdev.unil.ch:80>
ServerName wwwdev.unil.ch
CustomLog /var/log/httpd/wwwdev.unil.ch-access.log combined
#CustomLog "|/bin/grep -v '\" 302 ' >>
/var/log/httpd/wwwdev.unil.ch-access.log" combined
ErrorLog /var/log/httpd/wwwdev.unil.ch-error.log
DocumentRoot /var/www/vhosts/wwwdev.unil.ch/html
ScriptAlias /cgi "/var/www/vhosts/wwwdev.unil.ch/cgi-bin"
# Redirect de la page chgt de password (ci)
RedirectMatch ^/ci/pass /ci/page2845_fr.html
#
#
#Redirect de HP www.unil.ch 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 http://www.edicom.ch
RewriteEngine On
RewriteLog logs/jahia-rewrite
RewriteLogLevel 9
RewriteMap JahiaMap prg:/etc/httpd/conf/map/HashKey2Url.pl
RewriteMap ReverseJahiaMap prg:/etc/httpd/conf/map/HashUrl2Key.pl
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}
-f
RewriteRule ^(.*) /var/tomcat4/webapps$1 [L,NS]
#Find in tomcat jahia directory
RewriteCond %{REQUEST_URI} !^/(Jahia|administration).*
RewriteCond /var/tomcat4/jahia%{REQUEST_URI}
-f
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}
NULL
#RewriteCond ${JahiaMap:%1|NULL} NULL
RewriteRule ^(.*) http://www2.unil.ch$1 [R,L,NS]
</VirtualHost>
*************************************************************
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
1.3
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: helpdesk@unil.ch
(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: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