2016-07-24 111 views
0

我們最近將我們的網站更改爲WordPress,目錄中的WordPress文件/ wp/ 我仍然希望爲來自其他根目錄目錄的其他頁面提供服務,例如,鏈接如 http://www.2minuteexplainer.com/clients/xxx/some_subdir/從WordPress中排除頂級目錄htaccess重寫規則

但是,任何到達此目錄的嘗試都會返回一個Wordpress 404錯誤。如果我在htaccess中註釋掉 WordPress的東西,上面的鏈接按預期工作,但是,當然,舊網站的其他部分也會顯示出來。我不能找到正確的重寫規則組合。

這裏是htaccess文件。

Header add Access-Control-Allow-Origin "*" 
Options +FollowSymLinks 

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^(www.)?2minuteexplainer.com$ 

# RewriteRule ^clients/.*$ /clients$ - [PT] 
# one of a number of workarounds I've tried in order to use this directory 

# canonical WordPress stuff follows: 

RewriteRule ^(/)?$ wp [L] 

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /wp/ 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /wp/index.php [L] 
</IfModule> 

# END WordPress 

好像我必須犯一個簡單的錯誤。但它是什麼?

Thx。

+0

我的託管服務提供商,Lunarpages,爲我回答了這個問題,所以我想我會傳遞它。下面回答。 –

回答

0

解決的辦法是將mod_rewrite的東西(以#BEGIN WordPress開頭)移動到控制WordPress安裝的.htaccess文件中。這是/ wp /在我的情況。簡單的,一旦你知道如何:-)