2013-01-11 59 views
0

我在我的根目錄中安裝了WP多站點。我目前還有一個網站使用Invision Power的IP內容在這個目錄中運行,但是重命名了index.php文件以適應wordpress。我正在/論壇中運行IP Board。Wordpress主頁獲取重定向到其他CMS主頁

我創建了一個wordpress頁面(domain.tld/sample-page /),但是當瀏覽到它時,它無法找到它(着陸頁不是WP,而是IP內容「我們找不到頁面你正在尋找),看起來我的網站正在查看WP之前的IP內容數據庫,因此無法在其自己的數據庫中找到該頁面/目錄,因爲/ sample-page /不存在於其中,只能在WP數據庫。

當我去domain.com/index.php(應該把我的WP博客)我得到在www.domain.com重定向到我家的IP內容頁。

怎樣纔可以有它看起來像WP數據庫這樣的事情?

我的.htaccess文件:

# Loads home.php first (ip.content). Wordpress is index.php 

DirectoryIndex home.php index.php index.html maintenance.html 

<IfModule mod_rewrite.c> 
Options -MultiViews 
RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !.*\.(jpeg|jpg|gif|png|ico)$ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /home.php [L] 
</IfModule> 


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

# Multisite 

RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 

# add a trailing slash to /wp-admin 
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] 

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule^- [L] 
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] 
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] 
RewriteRule . index.php [L] 

# Multisite 

# END WordPress 

回答

2

第一組條件使得任何不是圖片,文件或目錄去home.php前端控制器,這將防止其在被滿足類似的WordPress規則。你可以添加一些更具體的條件,只將某些頁面傳遞給home.php,或者刪除那些條件和規則。

這兩個CMS不能很好地運行在一起,我會把它們放在單獨的域或子域中。

+0

非常感謝你的回覆。我需要IP內容的第一組條件。我試圖研究添加什麼樣的條件,但沒有提出太多。我確實發現這個線程,這聽起來與我的情況類似:http://stackoverflow.com/questions/3434610/problems-with-wordpress-mod-rewrite-rules-when-requesting-existing-files?rq=1你有什麼想法我需要什麼樣的條件? – myladeybugg

+1

如果您想要WordPress提供特定的頁面,您可以在第一個重寫規則不適用的條件下對其進行命名。 Apache重寫文檔是http://httpd.apache.org/docs/current/mod/mod_rewrite.html –

+0

我試過RewriteEngine RewriteCond%{REQUEST_URI}!^。* /(tools | learn | _)($ | /.*$)[NC] RewriteRule ^(。*)$ /index.php?p = $ 1'但它仍然查看IP內容,然後找不到頁面。如果我正確閱讀我的代碼,它說如果URL不是domain.com/tools或者學習或_然後查看index.php? – myladeybugg