I am trying to transfer everything after / to the GET variable in php , including additional request parameters. I managed to pass only

 /rand/rand2/?p=1 

in the request of the form http://test.ru/rand/rand2/?rand3=1&rand4=2

Using code:

 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^(.*)$ engine.php?u=$1?%1 [L,QSA] 

But &rand4=2 not transmitted.

How to transfer absolutely everything that exists after http://test.ru/ ?

The solution should be universal, that is, everything after / is completely random data.

  • one
    Do not invent the bicycle, but take a look at $_SERVER['REQUEST_URI'] . - Visman
  • For sure! Thank you very much, as I forgot that php means can be the same :)) - Round

0