小编cnu*_*cnu的帖子

从 Wordpress URL 中删除 index.php

我是 Wordpress 的新手,但尝试了所有文档和 Stack Overflow 帖子以寻求可能的解决方案,但到目前为止它们都没有奏效。

我已经验证 mod rewrite 已启用并按预期工作。遵循此处提到的所有步骤。https://wordpress.stackexchange.com/questions/105795/remove-index-php-from-permalinks

还重新启动了 Apache 几次,但当我从永久链接设置中删除 index.php 路径时仍然出现 404 错误。

将 wordpress 目录重命名为 blog 以访问位于 www.xyz.com/blog 的站点。现在的要求是访问任何带有 www.xyz.com/blog/2018/02/09/my-wp-post 且 URL 中没有 index.php 的博客文章。

除了用于博客站点的 WP 之外,我们没有任何其他 CMS 内容。

固定链接设置(自定义结构):/index.php/%year%/%monthnum%/%day%/%postname%/

.htaccess 文件内容:

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

apache wordpress .htaccess mod-rewrite permalinks

1
推荐指数
1
解决办法
3397
查看次数

标签 统计

.htaccess ×1

apache ×1

mod-rewrite ×1

permalinks ×1

wordpress ×1