Htaccess with cakephp on Justhost account 500

I am having a problem with the .htaccess file on my justhost.com account. I get persistent internal 500 errors and I have tried many different solutions on the Internet. Here's 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 problem 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 RewriteBase to /, but this does not fix the problem.

+4
source share
2 answers

You must use the Rewrite base in the three .htaccess files. In the root directory containing the application directories, lib, the plugin and the provider should look like

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

The application / htaccess should look like

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

Finally, the application / 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 library is not in the root folder, you will also need to change the values ​​in core.php to map it to the corresponding address. To do this, you can check the advanced setting in the cooks book.

+13
source

Check file permissions.

Disconnect your htacess file and write echo 1; exit index.php and check the weather, showing or not.

+1
source

Source: https://habr.com/ru/post/1447573/


All Articles