Help please, I spent 4 hours already so and it didn't work out ((
There are links of the form /catalog/razdel1/razdel2 , etc. at the end /ID/ ID - numbers, 4-5 characters
It is necessary to get links for all such links of the form /catalog/view/ID/ . But either it doesn’t work, or cyclic redirects are coming (
tried this:
RewriteCond %{REQUEST_URI} !^catalog/view/$ RewriteRule ^(.*)/([0-9]*)/(.*)$ /catalog/view/$2/$3 [R=301,L] so
RewriteCond %{REQUEST_URI} ^(.*)/([^view]*)/([0-9]*)/(.*)$ RewriteRule (.*) /catalog/view/%3/%4 [R=301,L] Tell me how to do it right! Thank!
Place in htaccess where editing takes place
<IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On #RewriteRule ^catalog/(.*)/([0-9]*)/(.*)$ catalog/view/$2/$3 [R=301] #RewriteCond %{REQUEST_URI} ^(.*)!view/(.*)/([0-9]*)/(.*)$ RewriteCond %{REQUEST_URI} !^catalog/view$ #RewriteCond %{REQUEST_URI} ^(.*)/([0-9]*)/(.*)$ RewriteCond %{REQUEST_URI} ^(.*)/([0-9]*)/(.*)$ #RewriteRule ^(.*)/([0-9]*)/(.*)$ /catalog/view/$2/$3 [R=301,L] RewriteRule ^(.*)$ /catalog/view/%2/%3 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$ RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L] RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}] </IfModule>