cnu*_*cnu 1 apache wordpress .htaccess mod-rewrite permalinks
我是 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>
我花了大量时间尝试在这里或其他地方回答的许多不同方法,但没有一个解决了我的问题。
这就是我所做的,它解决了我的问题。
httpd.conf 文件中的条目:
<Directory "/var/www/html/blog">
Options FollowSymLinks
AllowOverride All
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3397 次 |
最近记录: |