Wordpress 永久链接正在运行,但/%postname%/未运行

Wordpress 永久链接正在运行,但/%postname%/未运行,wordpress,permalinks,apache2.4,Wordpress,Permalinks,Apache2.4,默认永久链接工作正常,但当我尝试将其更改为/%postname%/或任何其他类型时,它显示以下错误 有人知道为什么会这样吗。。? 服务器:ubuntu 20.04 在.htaccess文件中添加以下代码: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f

默认永久链接工作正常,但当我尝试将其更改为
/%postname%/
或任何其他类型时,它显示以下错误

有人知道为什么会这样吗。。? 服务器:ubuntu 20.04


在.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
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress

使用此代码,永久链接的形状为:domainname.com\index\.php\postname,而我需要域。com//%postname%//很抱歉延迟回复。只需从代码中删除/index.php,然后通知我。