I got the next trouble, i have to redirect from my domain to external URLs that come inside the QUERY_STRING, but some times a recives those URLs on UTF-8 encoding (I really need to recive it like this).
Examples:
mydomain.com/index?page=http%3a%2f%2fwww.google.com --> must redirect to http://www.google.com
localhost/home.htm?page=http%3a%2f%2ftakeforum.com%2fdatakeydev --> must redirect to http://takeforum.com/datakeydev
I'm trying with this code, but no luck yet. The 301page chage the link to http://127.0.0.1/?page=http://google.com.
- Code: Select all
rewriteEngine on
RewriteMap escaping int:escape
RewriteCond %{QUERY_STRING} ^.*_page=(http.*)$ [OR]
RewriteCond %{QUERY_STRING} ^.*_page=(www\..*)$
RewriteRule ^/.*$ ${scaping:%1} [R,L]
And my rewrite log show:
- Code: Select all
init rewrite engine with requested uri /inicio.jsp
applying pattern '^/.*$' to uri '/inicio.jsp'
RewriteCond: input='page=www.google.com' pattern='^.*page=(http.*)$' => not-matched
RewriteCond: input='page=www.google.com' pattern='^.*page=(www\..*)$' => matched
rewrite '/inicio.jsp' -> ']?'
split uri=]? -> uri=], args=<none>
explicitly forcing redirect with http://127.0.0.1:8080/]
escaping http://127.0.0.1:8080/] for redirect
redirect to http://127.0.0.1:8080/%5d [REDIRECT/302]
Any help??????