Reputation: 153
I have a wordpress installation in my app/webroot/blog folder of CakePHP, i access normally to my www.example.com/blog/, but when i enter to an article i loose the link, for example i get www.example.com/blog/app/webroot/blog/?p=1
Is there a solution to fix that? i think i should modify my wordpress .htaccess but i don't know what to add.
my wordpress .htaccess file is:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
My Cakephp app/.htaccess is
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
And my Cakephp app/webroot/.htaccess is
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Cheers
Upvotes: 0
Views: 693
Reputation: 1378
The way I did it was to put the wordpress folder inside the root, and call it /blog.
Note that this isn't going into Cake's webroot folder, it's just putting the folder in the actual root, alongside /app, /lib, /plugins etc.
Then I modified the root's .htaccess file to look like this:
<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>
This seemed like the best way to completely separate the cake parts of the site from the wordpress parts.
It works well for me.
Upvotes: 2