Bug 42686 - Apache converting double slashes to single slash
Summary: Apache converting double slashes to single slash
Status: RESOLVED DUPLICATE of bug 20036
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.2.4
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-18 03:04 UTC by Ross Lawley
Modified: 2007-06-18 03:50 UTC (History)
0 users



Attachments
rewrite log - double slash already removed (4.05 KB, text/plain)
2007-06-18 03:21 UTC, Ross Lawley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Lawley 2007-06-18 03:04:07 UTC
Mod_rewrite is stripping double slashes so that :

http://mysite.com/search//10

Is producing the following $_SERVER variables:

'QUERY_STRING' => '/search/10',
'REQUEST_URI' => '/search//10'

So when mapping a url to /search/search_term/results_per_page  - the stripped slash means that it is 
interpreted as searching for "10" and not a blank search.
Comment 1 Ross Lawley 2007-06-18 03:17:57 UTC
Seems like it may be an Apache issue - as when calling the index.php with the PATH_INFO also strips 
the slashes:

http://mysite.com/index.php/search//10

produces the following:

'QUERY_STRING' => '',
'REQUEST_URI' => '/tmp/rewrite/index.php/search//10',
'SCRIPT_NAME' => '/tmp/rewrite/index.php',
'PATH_INFO' => '/search/10',
'PHP_SELF' => '/tmp/rewrite/index.php/search//10'

Comment 2 Ross Lawley 2007-06-18 03:21:48 UTC
Created attachment 20363 [details]
rewrite log - double slash already removed
Comment 3 Ross Lawley 2007-06-18 03:23:34 UTC
Added the mod_rewrite log for the test URL: http://mysite.com/search/content//19

Which shows that the double slash is already removed from the path supplied to mod_rewrite.  So it's 
*not* a mod_rewrite issue! 
Comment 4 Davi Arnaut 2007-06-18 03:50:22 UTC
We must definitely review which environment variables we should canonicalize
and which we shouldn't. In the mean time, the CGI Specification for further
reference:

http://hoohoo.ncsa.uiuc.edu/cgi/env.html


*** This bug has been marked as a duplicate of 20036 ***