php - Rewrite automatically removes backslash if there's more than one? -
i have simple url rewriting rules:
rewriteengine on rewritecond %{http_host} !script.php rewriterule ^test/(.*) script.php?q=$1
the thought have kind of urls: http://mywebsite.com/test/http://example.com
, send http://example.com
script.php query parameter. problem i'm receiving http:/example.com
instead of http://example.com
. also, http:////example.com
sent http:/example.com
. causes behavior ?
apache mod_rewrite
engine converts multiple ///...
single /
pattern matching in rewriterule
directive. if match using rewritecond
can match multiple /
s.
you can utilize rule this:
rewriteengine on rewritebase / rewritecond %{request_uri} ^/+test/+(https?://.+)$ [nc] rewriterule ^ script.php?q=%1 [l,qsa]
php regex .htaccess mod-rewrite redirect
No comments:
Post a Comment