As with the help of htaccess, you can do the following: All requests to the directory, for example, the directory processes the script at

directory/get.php 

And in the address bar gets the address

 directory/строка_запроса 

Here's how to achieve this?

  • and something like this RewriteRule ^ directory /(.*) directory / get.php? q = $ 1 q is a parameter, the script must somehow get the line. - KoVadim 2:17 pm
  • @KoVadim I did not understand, so I’ll explain more realistically. A request of type faq / answer123, get.php should get it as get.php? Answer123, the number will change, naturally. Url should remain as answer123 - Vitali RS
  • @KoVadim And I would also like to know where you can get detailed literature on this case - Vitaly RS
  • one
    Can I be more careful with words? we're not on the street. RewriteRule ^ faq / (. *) = (\ D +) $ get.php? $ 1 $ 2 to read - start here . The truth is there in English ... but Google will tell you exactly where to find it in Russian. - KoVadim

1 answer 1

I solved my problem like this: RewriteEngine on RewriteRule ^ answer ([0-9] +) /? get.php? answer = $ 1 [L]