You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by CSN <co...@yahoo.com> on 2004/10/14 23:37:37 UTC

[users@httpd] mod_rewrite turning // into /

I want to have urls like this:
/link/http://www.apache.org

rewritten to:
/link.php?url=http://www.apache.org

Here's my mod_rewrite line:
RewriteRule ^link/(.+)$ /link.php?url=$1 [QSA,L]

It appears that "url" is getting the // changed to a
single / i.e. "http:/www.apache.org". Any help?

Thanks,
CSN


		
__________________________________
Do you Yahoo!?
Y! Messenger - Communicate in real time. Download now. 
http://messenger.yahoo.com

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


Re: [users@httpd] mod_rewrite turning // into /

Posted by André Malo <nd...@perlig.de>.
* CSN <co...@yahoo.com> wrote:

> I want to have urls like this:
> /link/http://www.apache.org
> 
> rewritten to:
> /link.php?url=http://www.apache.org
> 
> Here's my mod_rewrite line:
> RewriteRule ^link/(.+)$ /link.php?url=$1 [QSA,L]
> 
> It appears that "url" is getting the // changed to a
> single / i.e. "http:/www.apache.org". Any help?

It's in the apache 2 core, which normalizes the url path to single slashes.
You  might have luck with evaluating %{THE_REQUEST} directly.

HTH, nd
-- 
die (eval q-qq[Just Another Perl Hacker
]
;-)
# André Malo, <http://pub.perlig.de/> #

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


Re: [users@httpd] mod_rewrite turning // into /

Posted by Robert Andersson <ro...@profundis.nu>.
CSN wrote:
> It appears that "url" is getting the // changed to a
> single / i.e. "http:/www.apache.org". Any help?

I don't know for sure, but it might be the browser that is stripping the 
slash before it makes the request. Use the rewrite log to see what the 
actual request uri is.

Regards,
Robert Andersson 


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