Redirect problem with htaccess and cakephp


#1

Hi everybody. I would like to ask your help with a problem i’m having with an infinite loop (redirect). I read many old post but didn’t find something very helpful. The problem is this:

I have a cakephp application running on DH. It’s working fine with no problem. But have to allow an upload of files about 10-12 mb so i came to the problem of modifying php.ini.

I created the cgi-bin directory, copied the php.cgi and php.ini files and modified theirs permissions. (755 on cgi-bin, 750 on php.cgi and 644 on php.ini).

Also i modified the .htaccess files in / (my document root) and in /webroot. They had this code:


.htaccess in document root / :


Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi

RewriteEngine on #RewriteLogLevel 3 #RewriteLog "/home/tsc_dev/rewrite.log" RewriteCond %{HTTP_USER_AGENT} ^(Mozilla.*|Opera.*) RewriteRule ^$ webroot/ [L] RewriteCond %{HTTP_USER_AGENT} ^(Mozilla.*|Opera.*) RewriteRule (.*) webroot/$1 [L] RewriteCond %{ENV:REDIRECT_STATUS} 200 RewriteRule .* - [L]

.htaccess in /webroot:


Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

The problem i have is that i get the error 500 and the apache log says:

“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.”

If i disable the first three lines in htaccess files eveything works as expected (that’s the original status of this files).

I would really appreciate your help about this. I think, it’s up to a problem with .htaccess files but i wonder why would this be a problem if they work when i delete the first three lines ? i think it could be up to the server when looking for php.cgi (and .ini) file for the first time and causing a new redirect on the cgi-bin directory but i’m not sure.

Again, thanks a lot for any help you can bring me.

Julian Llanten.