2014-03-24 37 views
0

我在CakePHP的app/webroot/blog文件夾中安裝了wordpress安裝程序,通常訪問我的www.example.com/blog/,但是當我進入一篇文章我失去了鏈接,例如我得到www.example.com/blog/app/webroot/blog/?p=1在CakePHP的我的app/webroot/blog文件夾中安裝Wordpress

有沒有解決方案來解決這個問題?我想我應該修改我的wordpress .htaccess,但我不知道要添加什麼。

我的WordPress .htaccess文件是:

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

我CakePHP的應用程序/的.htaccess是

<IfModule mod_rewrite.c> 
    RewriteEngine on 
    RewriteRule ^$ webroot/ [L] 
    RewriteRule (.*) webroot/$1 [L] 
</IfModule> 

我的CakePHP的應用程序/ Web根目錄/的.htaccess是

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

乾杯

+0

這[blog](http://www.balistupa.com/blog/2010/08/how-to-redirect-appwebrootblog-into-blog-wordpress-cakephp/)可以幫助你。 – Rikesh

回答

2

我的方式d是將wordpress文件夾放在根目錄中,並將其命名爲/ blog。

請注意,這是不會到蛋糕的根目錄文件夾,它只是把文件夾中的實際的根,沿着/應用程序,/ lib下,/插件等,

然後我修改根目錄的.htaccess文件看起來像這樣:

<IfModule mod_rewrite.c> 
    RewriteEngine on 
    RewriteBase/

    # Disable rewriting for the wordpress blog 
    RewriteCond %{REQUEST_URI} ^/blog/ [NC] 
    RewriteRule (.*) $1 [L] 

    # Normal CakePHP rewriting 
    RewriteRule ^$ app/webroot/ [L] 
    RewriteRule (.*) app/webroot/$1 [L] 
</IfModule> 

這似乎是將網站的蛋糕部分與wordpress部分完全分開的最佳方式。

它適用於我。

相關問題