S
S
Stanislav Vasiliev2016-01-29 16:42:09
htaccess
Stanislav Vasiliev, 2016-01-29 16:42:09

How to intercept a GET request to an existing file via htaccess?

Can you please tell me how can I intercept a certain get request to an existing file and redirect it to another using htaccess?
For example, on request /dir/one.php? get =1 return /dir/two.php? get =1, and for any other request, return the first file as well.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Krasnov, 2016-01-29
@Creadome

RewriteCond %{QUERY_STRING} ^(get=1)$
RewriteRule ^/dir/one.php$ /dir/two.php?%1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question