到目前为止我已经尝试过这段代码:
AddType x-httpd-php54 .php
# 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
但我不知道我做错了什么。如果我转到 url.com/index.php,URL 会重写,它将更改为 url.com/。但是如果我去 url.com/index.php/sample url 将不会重写。我想我最后遗漏了一个通配符,但我根本无法弄清楚代码在做什么,所以很难调整。我试过在 SE 上查找,但找不到任何实际适用于 linux/wordpress 组合的东西。有什么想法吗?
最佳答案
实际上这个问题是用不同的方式解决的。请按照以下步骤操作:
第 1 步:转到 wp-admin
第 2 步:打开设置 > 永久链接
第 3 步:选中帖子名称
选项并保存
你现在已经完成了。现在检查 URL。
关于php - 从 URL 中间删除 index.php,linux 上的 wordpress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37469517/