htaccess issue with website having WordPress directory containing Cakephp website

I am working on website having front website made with WordPress and a WordPress directory

contains a dashboard folder having a cakephp website. Everything is working perfectly on my

Read More

local system but when I migrated the whole website to online server I am unable to access

www.mywebsite.com/dashboard folder as I read here

https://wordpress.stackexchange.com/questions/20152/cannot-access-non-wordpress-subdirectories-as-wordpress-overrides-them-with-a-40

this is a htaccess issue but I dont know htaccess coading at all so this link was confusing

to me if any one could explain me (in simple way) why this problem occurs? and how to

solve this problem? will be helpfull to me

my wordpress htaccess is

# 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>

# END WordPress

and cakephp htaccess which is in wordpress-install-directory/dashboard/cakephp-install

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

Related posts

Leave a Reply

3 comments

  1. It should be just a case of changing your .htaccess to match the below

    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteBase  wordpress-install-directory/dashboard
        RewriteRule    ^$    webroot/    [L]
        RewriteRule    (.*) webroot/$1    [L]
    </IfModule>
    

    Doing the above will tell cake that the needed files are within instal-directory/dashboard.

    You will also need to make the same change to webroot and app .htaccess

  2. If they are in different folders with independent .htaccess files, you might try to set the base directory for cakephp, like this:

    <IfModule mod_rewrite.c>
        RewriteEngine on
        # Could be dashboard or cakephp-install
        RewriteBase  /dashboard
        RewriteRule    ^$    webroot/    [L]
        RewriteRule    (.*) webroot/$1    [L]
    </IfModule>