繁体   English   中英

从Linux上的wordpress的URL中间删除index.php

[英]Remove index.php from middle of URL, wordpress on linux

到目前为止,我已经尝试了以下代码:

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:选中“ Post Name选项并保存

您现在完成了。 立即检查URL。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM