P
P
painfulangel2016-07-29 15:02:55
htaccess
painfulangel, 2016-07-29 15:02:55

How to make htaccess redirect without GET parameters?

Good afternoon everyone!
Can you please tell me how to make a redirect from the main page with GET parameters to the main one, but without GET parameters (as in the example below)?
For example:

http://site.ru/?q=444 => http://site.ru/
или 
http://site.ru/index.html?q=444 => http://site.ru/index.html

The rest of the pages should work as usual.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene K., 2016-08-01
@jin_x

End the second parameter of the RewriteRule with a question mark:
RewriteRule ^(.*)$ $1?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question