【发布时间】:2018-07-20 14:02:02
【问题描述】:
我是 Wordpress 的新手,但尝试了所有文档和 Stack Overflow 帖子以寻找可能的解决方案,但到目前为止都没有奏效。
我已验证 mod 重写已启用并按预期工作。遵循此处提到的所有步骤。 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>
【问题讨论】:
-
你的问题是 Too Broad 。通过添加永久链接结构来编辑您的问题,现在您的 url 的外观是什么,您想要实现什么,您的 wordpress 安装是否包含其他一些 cms/frameworks/static html,它是否位于子文件夹中,提供
.htaccess文件和等 -
请查看编辑并让我知道是否需要任何其他详细信息。
标签: wordpress apache .htaccess mod-rewrite permalinks