我有兩個類似的WordPress網站。如何避免重定向?
當我嘗試加載http://site.com/en/page1.php然後到http://site.com/page1.php
似乎自動重定向,我不得不改變重寫規則的htaccess的。
http://site.com/有htaccess的與內容whithin:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^en/.*$ en/index.php [L]
#RewriteRule . /index.php [L]
</IfModule>
# END WordPress
第二個是(對於http://site.com/en/):
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /en/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
哪些規則,我應該寫在這裏的工作是什麼?
請檢查前問了每個規則一樣。 – 2012-04-02 23:02:14
我以前試過做很多,所以我現在在這裏。我認爲編寫我嘗試過的所有變體並不好。例如RewriteRule^en /(.*)$ en/$ 1 [L]不起作用。 – Anthony 2012-04-02 23:06:15
第一個片段中的第二個規則如何與'/ en/foo'交互? – 2012-04-02 23:08:12