1

We are having trouble resolving an internal redirect loop on our Magento server. Error messages look as follows in apache log and are abundant:

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., referer: https://www.example.com/path/file

We have read through posts suggesting that we:

  • uncomment RewriteBase / in .htaccess (and in fact matched .htaccess to an older working version we had before the errors and there haven't been any changes made)
  • turn on LogLevel debug in httpd.conf to track down the problem - only additional information is redirected from r->uri = /index.php (or whatever other pages cause the issue -- which are many)
  • change web/url/redirect_to_base from 0 to 1 - this didn't fix the problem, but it DID stop /catalog/product/view/id/[PRODUCTID] from showing any product pages and caused them to redirect to index.php (home page)
  • tried setting LimitInternalRecursion to 1000 (as a test) and pages began erroring out (couldn't tell you the error as we use Cloudflare and it serves the pages cached when not available).
  • we are using CloudFlare, and have both restored visitor ip's to apache and magento. We have SSL set to full (strict) on CloudFlare and also serve a UCC certificate from our hosting provider.
  • running curl -v http://www.example.com on the server indicates a 302 - Moved Temporarily (not sure why it is temporary) to https://www.example.com (Server: cloudflare-nginx)
  • running curl -v https://www.example.com returns the actual home page html but with a 406 - Not Acceptable (also Server: cloudflare-nginx).

I'm kind of at a dead end. I don't know where else to look for answers.

We currently have our unsecure and secure base url's both set to https (to force https site-wide, can't seem to get around this because of the way Magento's CMS Static Block variables work for link-generation)

SecRuleEngine for mod_security2.c is OFF (as we have seen suggested elsewhere).

(selected exerpts from httpd.conf)

<Proxy "*">
    <IfModule mod_security2.c>
        SecRuleEngine Off
    </IfModule>
</Proxy>

<VirtualHost 1.2.3.4:80>
    ServerName example.com
    ServerAlias www.example.com
    UseCanonicalName Off
</VirtualHost>


<VirtualHost 1.2.3.4:80>
    ServerName static.example.com
    ServerAlias www.static.example.com
    UseCanonicalName Off
</VirtualHost>

<VirtualHost 1.2.3.4:443>
    ServerName example.com
    ServerAlias www.example.com
    UseCanonicalName Off

    SSLEngine on

    SSLCertificateFile /var/cpanel/ssl/installed/certs/example.crt
    SSLCertificateKeyFile /var/cpanel/ssl/installed/keys/example.key
    SSLCACertificateFile /var/cpanel/ssl/installed/cabundles/example.cabundle
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    <Directory "/home/user/public_html/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>
</VirtualHost>

<VirtualHost 1.2.3.4:443>
    ServerName static.example.com
    ServerAlias www.static.example.com
    UseCanonicalName Off

    SSLEngine on

    SSLCertificateFile /var/cpanel/ssl/installed/certs/example.crt
    SSLCertificateKeyFile /var/cpanel/ssl/installed/keys/example.key
    SSLCACertificateFile /var/cpanel/ssl/installed/cabundles/example.cabundle
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    <Directory "/home/user/public_html/static/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>
</VirtualHost>

We are currently running Magento CE 1.8.0

(magento root .htaccess file)

DirectoryIndex index.php

<IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>

<IfModule mod_ssl.c>
    SSLOptions StdEnvVars
</IfModule>

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^api/rest api.php?type=rest [QSA,L]
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    RewriteRule .* - [L,R=405]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{HTTP_HOST} ^example.com$ [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]
</IfModule>

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 week"
</IfModule>

Order allow,deny
Allow from all

magento /media .htaccess file

Options All -Indexes
<IfModule mod_php5.c>
    php_flag engine 0
</IfModule>

Options -ExecCGI

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* ../get.php [L]
</IfModule>

Any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.