.htaccess to pass FULL URL into other PHP link as $_GET

Posted by 4lvin on Server Fault See other posts from Server Fault or by 4lvin
Published on 2012-09-01T05:27:03Z Indexed on 2012/09/01 9:40 UTC
Read the original article Hit count: 133

Filed under:
|

From .htacces file, how to pass/redirect the FULL URL to another URL as GET Variable?

Like:

http://www.test.com/foo/bar.asp

will be redirected to:

http://www.newsite.com/?url=http://www.test.com/foo/bar.asp

With Full Url with Domain.
I tried:

RewriteEngine on
RedirectMatch 301 ^/(.*)\.asp http://www.newsite.com/?url=%{REQUEST_URI}

But it is going out like:

http://www.newsite.com/?url=?%{REQUEST_URI}

© Server Fault or respective owner

Related posts about .htaccess

Related posts about domain