2013-08-05 32 views
0

我的WordPress安裝在不同的文件夾從我的主網站:WordPress的索引頁是給404

/var/www/html/wordpress < = WP安裝

/var/www/html/main-site < =主網站

我想有WP當有人從我的主站點訪問/博客時顯示:

http://www.main-site.com/blog(注意:主站點用作真實站點的通用佔位符,因爲它是尚未推出)

我已成立了一個別名在我的httpd的conf文件:

Alias /blog /var/www/html/wordpress 
<Directory /var/www/html/main-site> 
    DirectoryIndex index.php 
    Options -MultiViews 
    AllowOverride All 
    order allow,deny 
    allow from all 
</Directory> 

我有以下爲WP我的.htaccess文件:

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

我得到一個404當我訪問http://www.main-site.com/blog但是當我訪問http://www.main-site.com/wp-admin/index.php時,它可以工作(但如果我訪問/ admin,我會得到一個404)。訪問示例博客文章和示例頁面也適用於我。

http://www.main-site.com/blog/hello-world/

http://www.main-site.com/blog/sample-page/

看起來重寫工作,但我的/博客索引頁不起作用。

任何建議將不勝感激。

感謝,

艾倫

+0

嘗試刷新你的重寫規則 – Mark

+0

我做了一些閱讀,但一個解決方案也不是很清楚。我需要下載一個插件來刷新我的重寫規則? –

+0

根據這位作者的重寫刷新按鈕,當你訪問WP-Admin> Settings> Permalinks時,WP會自動刷新重寫規則。 –

回答

0

終於想通這一個!事實證明,乘客已啓用,我必須禁用它。

Alias /blog /var/www/html/wordpress 
<Directory /var/www/html/main-site> 
    PassengerEnabled off 
    DirectoryIndex index.php 
    Options -MultiViews 
    AllowOverride All 
    order allow,deny 
    allow from all 
</Directory>