1

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

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>
Cœur
  • 37,241
  • 25
  • 195
  • 267
Subodh Ghulaxe
  • 18,333
  • 14
  • 83
  • 102
  • what error are you getting when you access the dashboard? – cheesemacfly Dec 15 '12 at 05:55
  • WordPress is giving 404 page not found error, if i delete htaccess file in WordPress install it starts working but I will have to use default Permalink Settings for WordPress otherwise WordPress pages and post don't work. – Subodh Ghulaxe Dec 15 '12 at 05:59
  • And the solution on the link you provide doesn't work? What about this one: http://wordpress.org/support/topic/404-error-from-the-dashboard-side – cheesemacfly Dec 15 '12 at 06:00
  • I have tried the solution on that link but I am not sure what I have done was correct as I don't know htaccess programming – Subodh Ghulaxe Dec 15 '12 at 06:03
  • If you delete the .htaccess then log in on using yourwebsite.com/wp-login.php and from here, go to Settings/Permalinks and click the Update Permalinks Structure button? – cheesemacfly Dec 15 '12 at 06:09

3 Answers3

1

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>
Felipe Alameda A
  • 11,791
  • 3
  • 29
  • 37
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

Shaz MJ
  • 1,785
  • 1
  • 12
  • 25
Matt Stephens
  • 922
  • 1
  • 6
  • 24
  • this was working perfectly but again have a API directory in cakephp install and again htaccess issue with api access .. so I have created a subdomain for dashboard and one for api.. Thanks – Subodh Ghulaxe Dec 21 '12 at 08:14
1

From a stackoverflow answer here:http://stackoverflow.com/questions/2322559/htaccess-wordpress-exclude-folder-from-rewriterule/2350305#2350305 add

RewriteCond %{REQUEST_URI} !^/(dashboard|dasboard/.*)$

before the last RewriteRule on your .htaccess file on wordpress directory and it should work.

tix3
  • 1,142
  • 8
  • 17
  • Actually just to be safe you might also want to rename the folder as the /dashboard/ seems to already be taken from wordpress. – tix3 Dec 21 '12 at 08:23