WordPress 页面永久链接在本地不起作用
我在服务器上有 WordPress 网站,创建了页面,工作正常,但是当我在本地下载 WordPress 文件和数据库并希望使用本地主机运行时,页面的永久链接不起作用。
I have wordpress website on server, created pages and that's working fine, but when I download wordpress files and DB on local and want to run with localhost, permalinks for pages are not working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这似乎是一篇旧文章,但这可能会帮助遇到相同错误的其他人。
选择:
Apache——> Apache 模块 –>这将显示可用模块的列表。
现在只需检查
rewrite_module
。来源 WordPress 自定义永久链接无法在本地主机中工作
希望有帮助。
It seems this is an old post, but this might help others that encounter same error.
Select:
Apache –> Apache Modules –> and that will display the lists of available modules.
Now just check
rewrite_module
.source from WordPress Custom Permalink not Working in Localhost
Hope that helps.
有时,当从一台服务器复制到另一台服务器时,WordPress 的永久链接会变得有点混乱,尝试将它们设置回默认值(使用管理面板),然后再次将它们设置为您想要的永久链接结构(确保每次都应用更改)。
Sometimes when copying from one server to another, wordpress' permalinks goes a little screwy, try setting them back to default (using the admin panel) and then setting them again to your desired permalink structure (being sure to apply the changes each time).
您需要进入数据库并更改一些选项。
转到您的 phpmyadmin 安装并导航到
wp-options
表。将siteurl
和 home 选项更改为您的localhost
地址。WordPress 需要这些数据库来尝试构建您的永久链接。如果它们是错误的,那么它会将您的链接定向到错误的位置。
you need to go into the database and change a few options.
Goto your phpmyadmin installation and navigate to
wp-options
table. Change thesiteurl
and home options to yourlocalhost
address.Wordpress needs these database tries to build your permalinks. If they are wrong, then it will direct your links to incorrect locations.
您只需执行以下操作即可解决此问题:
转到 WordPress 网站中的设置。
单击永久链接(您将看到新配置的 WP 站点的 URL 结构。(如果它显示您的原始网站值,请转到设置 -> 常规并设置您的本地站点 URL
不要进行任何更改,只需单击“保存”。按钮。
刷新您的本地站点并单击您的页面链接或帖子。
You can simply fix this by doing the following:
Go to settings in your WordPress site.
click on permalinks ( You will see the URL structures of your newly configured WP site. (if it shows your original website values, go to settings-> general and set your local site URLs
Don't do any changes, just click on the Save button.
Refresh your local site and click on your page link or post.