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 34602] mod_rewrite fails to correctly deal with URLS that have escapes in them
Date Sat, 09 Oct 2010 22:08:18 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=34602

--- Comment #48 from alada <aladajp@yahoo.co.jp> 2010-10-09 18:08:11 EDT ---
Here is the application of above php solution, if your web host still has an
Apache with this bug.
(The bug where an external htaccess redirect double encodes url parameters)

in .htaccess:
RewriteCond ...
RewriteRule .... /phplist_redirect10.php [L]

in the file phplist_redirect10.php:

<?php
header(
'Location: http://'
. $_SERVER['SERVER_NAME']
. preg_replace
    (
      '/^\/myfolder([\-_a-zA-Z0-9]+)\/(.*)$/'
     ,'/myfolder/$1/$2'
     ,$_SERVER['REQUEST_URI']
     ) 
,TRUE
,301  //301 for permanent redirect, 303 for temporary redirect
);


$_SERVER['REQUEST_URI']: the url as written in browser bar, contains first
slash. like /myfolder/myfolder/some.php?a=5#bcd

-- 
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