解决修改链接样式后wordpress访问文章异常的问题

首先,需要确认开启apache2的rewrite模块

a2enmod rewrite

确认开启后,确认apache2的站点设置中,相关目录开启.htaccess复写

<Directory /var/www/blog/>
#允许htaccess文件复写
AllowOverride ALL
</Directory>

最后,将以下内容写入wordpress所在文件夹的.htaccess文件中

# 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

Be the first to comment

Leave a comment

Your email address will not be published.


*


不够聪明的人工智能可进不来哦 *