httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46496] New: Using the rewriterule NO substitution to do a Redirect adds the DocumentRoot in front of the path
Date Thu, 08 Jan 2009 19:52:31 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46496

           Summary: Using the rewriterule NO substitution to do a Redirect
                    adds the DocumentRoot in front of the path
           Product: Apache httpd-2
           Version: 2.0.46
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_rewrite
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: chris.morgan@ama.ab.ca
                CC: chris.morgan@ama.ab.ca


I am using two RewriteRule's to change the path for shortcuts in our site. The
RewriteMap file contains a list of sort names to be redirected to specific
pages on all Hosts located on this server. This works until I make the call
from a https://www.myserver.com/shortname and the shortname maps to a ssl page
(https://www.myserver.com/The_full_page_name.html. It will work if I am on a
http:// page and go to both http:// or https:// pages. If I start with the URL
using a https:// call then it will work if I go to a http:// page but fails
with a 404 for any https://www.myserver.com/... (Note: If I go to other domains
then a https:// call will work).

I did a RewriteLog file and the result seems to be that it is that the second
RewriteRule is putting the DocumentRoot path infront of the new path that was
set in the previous RewirteRule.


(Config snip)
# Create an Environment Variable with a Lower Case version of the URL.
RewriteMap tolower  int:tolower
RewriteRule ^(/[a-z0-9\ \-_]*)(/?)$  -  [NC,E=LowerCasePath:${tolower:$1}]

# Redirects for all Hosts using this webserver
RewriteMap map_all  txt:/etc/httpd/conf/map_all.txt
RewriteRule ^(/[a-z0-9\ \-_]*)$  ${map_all:~%{ENV:LowerCasePath}|$1}  [NC,C]
RewriteRule !^(/[a-z0-9\ \-_]*)$  -  [NC,R=301,L]

(map_all.txt)
~/            http://www.myserver.com/Default_home_page.html
~/shortname   https://www.myserver.com/The_full_page_name.html
~/accounting  http://www.myserver.com/path_for_accounting/accounting.html


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message