htaccess mod rewrite changes http://www to http:/www

Posted by Nir on Stack Overflow See other posts from Stack Overflow or by Nir
Published on 2010-05-14T21:07:18Z Indexed on 2010/05/14 21:14 UTC
Read the original article Hit count: 428

I want to replace calls like this:

www.mysite.com/sub/file.php?param1=x&param2=http://www.someurl.com

with:

www.mysite.com/sub/param1/param2

Param 1 is an integer number Param 2 is a url

I wrote this rewrite rule in htaccess:

RewriteCond %{REQUEST_URI} \/sub\/
RewriteRule sub\/([0-9]+)\/(.*)$  sub\/file.php?param1=$2&param2=$1 [L] 

Unfortunately param2 (the URL) starts with http:/www.someurl.com instead of http://www.someurl.com (note the single slash).

Any idea what causes it? When I call the same file with same parameters in the format www.mysite.com/sub/file.php?param1=x&param2=http://www.someurl.com , param2 does appear OK so it must be something with the rewrite rule.

© Stack Overflow or respective owner

Related posts about htaccess

Related posts about mod