0
votes

I need to setup cakephp in the sub directory of my site - cms. I tried various .htaccess rules but I get error 500 and 404 error. I am on GoDaddy Deluxe Linux Hosting with cPanel.

Following is what I tried.

In CMS folder:

<IfModule mod_rewrite.c>
#Options +FollowSymlinks
RewriteEngine on
RewriteBase /cms/
#RewriteBase /mysite.com/cms/
RewriteRule    ^$ app/webroot/    [L]
RewriteRule    (.*) app/webroot/$1 [L]
</IfModule> 

In CMS > App folder:

<IfModule mod_rewrite.c>
#Options +FollowSymlinks
RewriteEngine on
RewriteBase /cms/
#RewriteBase /mysite.com/cms/
RewriteRule    ^$    webroot/    [L]
RewriteRule    (.*) webroot/$1    [L]
</IfModule>

In CMS > App > Webroot:

<IfModule mod_rewrite.c>
#Options +FollowSymlinks
RewriteEngine On
RewriteBase /cms/
#RewriteBase /mysite.com/cms/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

Kindly help me get the working .htaccess rules.

1

1 Answers

0
votes

You need to use proper RewriteBase.

Try:

In CMS > App folder:

<IfModule mod_rewrite.c>
#Options +FollowSymlinks
RewriteEngine on
RewriteBase /cms/app/

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

In CMS > App > Webroot:

<IfModule mod_rewrite.c>
#Options +FollowSymlinks
RewriteEngine On
RewriteBase /cms/app/webroot/

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

Your /cms/.htaccess looks fine.