最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

redirect - Regex expression for redirecting image URLs to another folder

programmeradmin4浏览0评论

I have changed the upload folder to a folder called "images" in the root folder by entering define('UPLOADS', 'images'); inside wp-config.php file. My Media settings had the images organized into month and year. I changed that not to use any date organization. I want to be able to redirect all previous image URLs that were in the form of siteroot/wp-content/uploads/2020/02/image.png to point to the new folder, like this siteroot/images/image.png. Not all images are PNGs, of course, I would need that to happen for every file inside the previous upload folder and subfolders! I can copy all existing individual images and other files into the images root folder but I am not sure how to set up the redirection. Yoast Premium has a redirection module that can accept regular expressions.

Can anyone suggest a regex that will work?

发布评论

评论列表(0)

  1. 暂无评论