htaccess mod rewrite changes http://www to http:/www
- by Nir
I want to replace calls like this:
www.mysite.com/sub/file.php?param1=x¶m2=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¶m2=$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¶m2=http://www.someurl.com , param2 does appear OK so it must be something with the rewrite rule.