V
V
vlad17532020-04-17 18:18:07
htaccess
vlad1753, 2020-04-17 18:18:07

How to remove keys from URL?

Hello.

There is a link: gdz2/index.php?id=2

Need to remove the "?id=2" keys.

Preferably the URL should look like this: gdz2/index

I think it can be done with .htaccess, but I have no idea how to do it. ..
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-04-17
@vlad1753

RewriteCond %{QUERY_STRING} (^|&)id\=2($|&)
RewriteRule ^gdz2/index\.php$ /gdz2/index? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question