在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
。
任何人都知道我在做什麼錯了?