【发布时间】:2016-08-13 09:01:25
【问题描述】:
我有一个结构如下的网站
public_html
files and folders like index.php and terms.php - this is what loads mywebsite.com
blog folder
wp-admin
wp-content
wp-includes
index.php
当我现在打开 mywebsite.com 时,它会加载。当我打开 mywebsite.com/terms 时,它会加载。当我打开 mywebsite.com/blog 时,它会加载。但 mywebsite.com/blog/my-first-post 无法加载。
根据 wordpress 我在 .htaccess 中设置:
<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>
现在 mywebsite.com/blog/my-first-post 会加载,但 mywebsite.com/ 之后的其他任何内容都不会加载。 mywebsite.com/terms 和 mywebsite.com/dashboard/myaccount 等都不是。由于某种原因,这些页面现在似乎在博客中,显然这就是它们显示 404 错误的原因。
【问题讨论】: