A
A
atHome2019-07-18 16:07:02
htaccess
atHome, 2019-07-18 16:07:02

How to pick up a hidden GET request in httacess?

Good afternoon!
How to hide GET request in httacess.
There are pages like
site.com/gallery/dog
site.com/gallery/cat It is
necessary that when navigating through them, a query like this is taken:
site.com/gallery/?cat=dog
site.com/gallery/?cat=dog
So that the user does not saw ?cat= and php handled it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Ustyugov, 2019-07-18
@atHome

RewriteEngine On
RewriteRule ^gallery/(.*)$ /gallery/?cat=$1 [L]

K
krypt3r, 2017-10-25
@krypt3r

if (!empty($_GET['test'])) {
    // что-то делать с параметром test из GET-запроса
    var_dump($_GET['test']);
}

It's in the 2_page.php code. Don't forget to validate your input.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question