I
I
inavo2020-07-08 22:08:07
htaccess
inavo, 2020-07-08 22:08:07

How to redirect from /?/ to / in htaccess?

I have links like site.ru/news/?/, site.ru/news2/?/?/ , how can I redirect to site.ru/news/ via htaccess?

I tried to write like this, but it doesn't work.

RewriteCond %{REQUEST_URI} ^(.*?)\/\?\/(.*?)$
RewriteRule ^(.*)$ /$0 [R=301,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-07-08
@inavo

RewriteCond %{THE_REQUEST} /\?/
RewriteRule .* /$0? [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question