I am trying to set up a redirect for images, due to a change in the location of images relative to the root, as well as the name of the images.

Example of the previous address: http: //sayt.rf/directory/i/img_03_01.jpg

Example of a new address: http: //sayt.rf/i/cat/podcat/img-03-01.jpg

This kind of string for some reason does not work:

RewriteRule ^ directory / i / img _ ([0-9] +) _ ([0-9] +). Jpg $ i / cat / podcat / img- $ 1- $ 2.jpg [R = 301, L]

  • Perhaps the Cyrillic does not understand. Replace the каталог with [^/]+ . If you only had pictures in this directory, then there should not be any problems with redirection. - Visman
  • I tried to replace as you said, but everything still - the redirect does not work - crawler777
  • So can you have other rules in .htaccess? Or the server is not apache? - Visman
  • Here are all the rules from htaccess: - crawler777
  • RewriteEngine On RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://сайт.рф/ [R=301,L] RewriteCond %{HTTP_HOST} ^www.сайт.рф RewriteRule (.*) http://сайт.рф/$1 [R=301,L] RewriteRule ^(.*)$ index.php [L,QSA] - crawler777

0