Answer the question
In order to leave comments, you need to log in
How to keep the old image urls when changing their paths?
After restructuring the directory with images, their paths will change as follows:
Сейчас:
/5aefce2c8ec8f389ea4ec77ec1b90a34.jpg
/45149b36b87bdabdf64ce789c105e441.jpg
/a077e9957f2265798d9cacc0133c6268.jpg
Будет:
/5a/5aefce2c8ec8f389ea4ec77ec1b90a34.jpg
/45/45149b36b87bdabdf64ce789c105e441.jpg
/a0/a077e9957f2265798d9cacc0133c6268.jpg
Answer the question
In order to leave comments, you need to log in
nginx-rewrite returning a permanent redirect and cutting out all the old links won't work in your case?
You can make a regular expression in Nginx and the paths will be saved. Just need more data to make it up. Rather, you need more data so that the compiled regular season does not break something else) You need to look at the structure of the site and the virtual host.
https://nginx.ru/ru/docs/http/ngx_http_rewrite_mod...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question