本文介绍了Wordpress (Postname Permalink) 404 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Wordpress 永久链接有问题.我试图将永久链接更改为 postname "/%postname%/".当我测试我的一个页面时,它说 404 Not Found.

I have a problem with my Wordpress permalink. I tried to change permalink to postname "/%postname%/". When I test one of my page, its says that 404 Not Found.

我环顾四周,尝试了很多教程,但都没有成功.在我看来,我的 Wordpress 访问似乎不起作用,但我不确定,因为我是新手.请任何人都可以帮我解决这个问题.

I've looking around about my problem and tried many tutorials but no luck. In my opinion, my Wordpress access seems not working but I'm not sure because I'm newbie for this. Please anyone can help me solve this problem.

提前致谢

推荐答案

请检查你的 .htaccess 如果没有删除所有代码并写在下面:

Please check you .htaccess must look like below if not remove all code and write below:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

之后运行以下命令:

1 EDIT(将无"更改为全部")须藤vim/etc/apache2/apache2.conf

1 EDIT (Change None to all)sudo vim /etc/apache2/apache2.conf

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

到(按 i 编辑)

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

保存(按:wq!)

  1. sudo a2enmod 重写

  1. sudo a2enmod rewrite

sudo 服务 apache2 重启

sudo service apache2 restart

这篇关于Wordpress (Postname Permalink) 404 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 06:25