You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2010/10/10 00:08:18 UTC

DO NOT REPLY [Bug 34602] mod_rewrite fails to correctly deal with URLS that have escapes in them

https://issues.apache.org/bugzilla/show_bug.cgi?id=34602

--- Comment #48 from alada <al...@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