Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

htaccess with cakephp on justhost account 500 error

I am having an issue with the .htaccess file on a justhost.com account. I recieve constant internal 500 errors and I have tried many different solutions around the web. Here is what my htaccess files look like:

ROOT HTACCESS

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

app/ HTACCESS

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

app/webroot/ HTACCESS

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

The issue is that I get this in the error log:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Ive tried setting the RewriteBase to / but it doesnt correct the issue.

like image 268
Cameeob2003 Avatar asked Dec 08 '22 19:12

Cameeob2003


2 Answers

You have to use Rewrite base in three .htaccess files. The one in the root directory which contain directories app , lib , plugin and vendor should look like

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

The app / htaccess should look like

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

And finally the app/webroot/htaccess should look like

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /app/webroot
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

If your lib is not in the root folder you will have to also the change the values in core.php to map it to relevant address. For that you can check out the advanced installation in the cook book.

like image 134
Anirudha Agashe Avatar answered Dec 11 '22 10:12

Anirudha Agashe


Check your file permission.

Switch off your htacess file and write echo 1;exit; index.php and check weather it shows or not.

like image 28
Sudip Saha Avatar answered Dec 11 '22 09:12

Sudip Saha