将 wordpress 移至子目录 - 图像未显示 - 重新链接?
我不是一个 WordPress 用户 - 但前几天我不得不将 WordPress 从 root 移动到一个子目录。
我按照 WordPress 网站上的步骤进行操作 - 一切都顺利进行。所有文章、登录等都显示正常。
问题是文章中的图像 - 它们链接到旧地址(来自根:www.domain.com/link/to/image);图像现在位于子目录中(www.domain.com/blog/link/to/image)
解决该问题的最佳方法是什么?显然,深入每篇文章并重新链接可以解决问题,但是有没有更简单、耗时更少的方法呢? .htaccess?其他一些有用的编码吗?再说一次,我不是一个 WordPress 专家,所以我不确定最好的方法是什么,但我认为除了手动浏览博客文章之外还必须有一些东西?
I'm not a wordpress person - but I had to move Wordpress to a subdirectory from root for a person the other day.
I followed the steps on the Wordpress site - and everything transferred fine. All the articles, logins, etc. display fine.
The issue is the images in the articles - they are linking to the old address (from root: www.domain.com/link/to/image); the images are now in a subdirectory (www.domain.com/blog/link/to/image)
What is the best way to resolve that? Obviously going into each article and re-linking would solve the issue but is there an easier, less time-intensive way? .htaccess? some other bit of coding that would be helpful? Again, I'm not a wordpress guy so I'm not sure what would be the best way to do this but I would think there has to be something besides manually going through blog posts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过:
WP-Admin 中的设置>>媒体设置
然后尝试更改两者:
“将上传内容存储在此文件夹中”默认为 wp-content/uploads
“文件的完整 URL 路径” 配置此选项是可选的。默认情况下,它应该是空白的。
这应该可以解决问题
Have you tried going to:
Settings in WP-Admin >> Media Settings
Then try changing both:
"Store uploads in this folder" Default is wp-content/uploads
"Full URL path to files" Configuring this is optional. By default, it should be blank.
This should do the trick
Search RegEx 是一个很好的插件,可以在所有帖子中使用 Grep 进行搜索和替换和页面。
Search RegEx is a good plugin to be able to search and replace with Grep through all posts and pages.