P
P
Pavel Sidorov2020-04-24 19:11:38
htaccess
Pavel Sidorov, 2020-04-24 19:11:38

How to set up a mass redirect on the run?

I do a redirect on the run. How to properly set up a mass redirect?
doing so

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On
  RewriteCond %{REQUEST_URI} ^/catalog/perchatki/$1
  RewriteRule ^(.*)$ /catalog/ekipirovka/perchatki/$1 [R=301,L]
</IfModule>


does not pass

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-04-24
@pavel__sidorov

firstly, if you select groups in RewriteCond, then they are substituted not as $1 but %1, since you can also collect RewriteRule groups, but in your case you can do without RewriteCond

RewriteEngine On
RewriteRule ^catalog/perchatki/(.*)$ /catalog/ekipirovka/perchatki/$1 [NC,R=301,L]

NC - case sensitive, can be omitted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question