Is it possible to handle such a url

http://www.example.com/http://www.test.com

I tried many different methods using .htaccess with no luck. I need the second URL to appear as a parameter. Is it possible to redirect it to index.php and get it like $_SERVER["REQUEST_URI"]or another method? Thanks

UPD: It seems that it is impossible to get the whole URL, question marks are not recognized. Perfect example:

127.0.0.1/http://www.test.com/script.php?a=hello&b=world#blabla;par2?%par3 

and I need to get the exact line index.php

www.test.com/script.php?a=hello&b=world#blabla;par2?%par3
+3
source share
3 answers

This is definitely possible: http://downforeveryoneorjustme.com/http://www.google.com/

As for how it was already on ServerFault

+2
source

Problem:

Apache, Windows. Apache Windows (:) REQUEST URI. URL-, http://www.mysite.com/C:/SomeFile.exe, .

mod_rewrite , .

(, wikipedia) URL :. Apache Windows?

:

, :

URL- : http://www.mysite.com/url/http://www.test.com

http://www.mysite.com/ - SCRIPT PATH /url/http://www.test.com - REQUEST URI.

, ​​ Colon (:) Slash (/).

+3

You can get a URI, but only without a fragment, since it is not being transmitted to the server. Try this rule:

RewriteRule ^http:/ index.php [L]

Then the requested URL request plus the request (so part from the third /to the first #or the end of the URI) is available at $_SERVER['REQUEST_URI'].

0
source

Source: https://habr.com/ru/post/1614407/


All Articles