L
L
Leonid Nimchenko2021-06-03 13:20:03
htaccess
Leonid Nimchenko, 2021-06-03 13:20:03

How to truncate combinations / with .htaccess? //? ///? after domain?

How to truncate combinations / with .htaccess? //? ///? after domain?
After the URL is truncated

RewriteRule ^(.*)\/$ http://%{HTTP_HOST}/$1 [L,R=301]

RewriteCond %{THE_REQUEST} \ /+([^\ \?]+)\?(\ |$)
RewriteRule ^(.*)$ /$1? [L,R=301]

But after the domain without paths is not cut off.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-06-03
@lculver

RewriteCond %{THE_REQUEST} \ /+([^\ \?]+)\?(\ |$)

Replaced byRewriteCond %{THE_REQUEST} " /[^?]*\? "

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question