[英]The permalinks in WordPress returns 404
I imported a wordpress production website into my local server to modify it and learn how to wordpress. 我将wordpress生产网站导入本地服务器以对其进行修改并学习如何使用wordpress。 I use LAMP and my WordPress project is located on a different Hard Drive than my Ubuntu 16.04 partition.
我使用LAMP,而我的WordPress项目与Ubuntu 16.04分区位于不同的硬盘上。 But even if I can access to the main page, all the other links (except /wp-admin) are returning a 404 not found error.
但是,即使我可以访问主页,所有其他链接(/ wp-admin除外)都返回404 not found错误。
As I could read, the problem could be that the .htaccess file was not read by apache2. 如我所读,问题可能是apache2未读取.htaccess文件。 To enable this option, I needed to enable the plugin rewrite with
sudo a2enmode rewrite
and to change in /etc/apache2/sites-enabled/000-default.conf
the : 要启用此选项,我需要使用
sudo a2enmode rewrite
启用插件重写,并在/etc/apache2/sites-enabled/000-default.conf
进行更改:
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
</Directory>
by : 创建人:
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
If this may correct the error 404, it creates an internal server error... 如果这可以纠正错误404,则会创建内部服务器错误...
Is anyone have an idea of how to handle this problem ? 有谁知道如何处理这个问题?
Thank you ! 谢谢 !
Have you flushed the rewrite rules yet? 您是否刷新了重写规则?
Go to Settings -> Permalinks and hit save. 转到设置->永久链接,然后点击保存。
Alternatively, you can do it from your theme by calling the flush_rewrite_rules() function. 另外,您可以通过调用flush_rewrite_rules()函数从您的主题中完成此操作。
当我需要为每个开发项目使用其他硬盘上的目录时,我更改了Apache2的服务器根目录,从而解决了我的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.