在WordPress中,我有一个名为Experiments
的页面,内容为experiments
。该页面应能够在http://site.com/experiments
访问。Wordpress上的目录覆盖
问题是,我也想在我的服务器上使用该名称的文件夹,以便http://site.com/experiments/thing/
加载文件夹的index.html
文件(如果有的话)。
我想我已经找到了完美的重写结构(从this blog post):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}/index.htm !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . /index.php [L]
</IfModule>
# BEGIN WordPress
# END WordPress
看起来它重写使用WordPress,除非该目录中有一个index.html或index.php文件目录在这种情况下,加载它忽略WordPress。并且它对子目录完美起作用,但http://site.com/experiments/
试图永远来回重定向到http://site.com/experiments
。
任何人都知道我在做什么错了?