【发布时间】:2018-12-16 01:36:59
【问题描述】:
我正在自己的服务器上移动一个 WordPress 网站。它设置在 /var/www/public_html/wp/wordpress 上。因此,要访问我的网站,您需要访问 example.com/wp/wordpress/。我在 public_html/.htaccess 中添加了这一行:
RewriteRule ^$ /wp/wordpress/index.php [L]
所以现在 example.com 将直接访问 WordPress。但是,现在帖子内有很多断开的链接。这些链接通常指向 example.com/webpage;实际页面可以在 example.com/wp/wordpress/index.php/webpage 找到。
如何正确重定向这些链接?
我还可以在 WordPress 数据库上运行 SQL 命令来直接修复链接(我使用的是 PHPMyAdmin)。
编辑:这里有一些截图。显然我还不能嵌入图片,但这里有一些链接。
Here's a broken link, inside the post
Here's the resulting 404, when following that link
And here's where the link is supposed to point
只是更改一个链接不会有问题,但是要手动完成的帖子太多。
【问题讨论】:
标签: php wordpress apache redirect hyperlink