P
P
po4emu4ka20202020-08-16 09:10:12
htaccess
po4emu4ka2020, 2020-08-16 09:10:12

How to make 301 redirect with % in URL?

Hello!
I'm trying to set up a 301 redirect from /catalog/razdel-%28strahovka%29/ to /catalog/razdeli/razdel-/

Tried like this: Redirect 301 /catalog/razdel-%28strahovka%29/ /catalog/razdeli/razdel-/

And like this :
RewriteCond %{REQUEST_URI} ^/catalog/razdel-%28strahovka%29/$
RewriteRule ^.*$ https://site.ru/catalog/razdeli/razdel-/ ? [R=301,L]

Tried to screen in various ways, but something doesn't work out.

Can you please tell me how to create such a redirect so that it works?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-08-16
@po4emu4ka2020

The RewriteRule receives a string as input after "%XX" has been decoded.
So /catalog/section-%28strahovka%29/ becomes /catalog/section-(strahovka)/.

RewriteRule ^catalog/razdel-\(strahovka\)/$ https://site.ru/catalog/razdeli/razdel-/? [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question