Answer the question
In order to leave comments, you need to log in
Mass replacement of links to images in the news?
Used Amazon S3, decided to refuse. The images were also stored locally, but the links led to aws.domain.net.
The problem is that the file structure is different.
How to bulk replace all format links:
aws.domain.net/content/2015/12/24200851/image_name.jpg
domain.net/wp-content/uploads/2015/12/image_name.jpg
Answer the question
In order to leave comments, you need to log in
There are a couple of keywords here, namely the file name and two directories (year and month). Based on these keywords, you can safely parse the database with a regular expression.
With a regular expression, you get three "variables", which you substitute in the new link in the next step. You change this new link to the old one in the context.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question