Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

url rewrite + ssl + redirection loop (ERR 310)
 
Laor
Jr. Member
 
Total Posts:  3
Joined:  2013-01-05
 

Hello all

I recently faced an infinite redirection loop issue when url rewrite and ssl were activated on my provider (gandi)
$_SERVER[’HTTPS’] was of course not setted (NULL), instead I noted that other variable, https related, where turned on. So If you have the same issue you can check by editing you index.php (root of your magento install) and put the following line on top of it :

echo '<pre>'print_r(get_defined_vars()); echo '</pre>';exit;
Then go (directly) to your https url (cart or account for example). then you can check https variable are ON. for me it looked like this :
Array
(
    
[_GET] => Array
        (
        )

    
[_POST] => Array
        (
        )

    
[_COOKIE] => Array
        (
            
[frontend] => blr9u9vsesi7mdcpc9s5p7i2q2
        
)

    
[_FILES] => Array
        (
        )

    
[_SERVER] => Array
        (
            
[USER] => hosting-user
            [HOME] 
=> /
            
[FCGI_ROLE] => RESPONDER
            [REDIRECT_HTTPS] 
=> on
            [REDIRECT_STATUS] 
=> 200
            [HTTP_USER_AGENT] 
=> Opera/9.80 (X11Linux x86_64Presto/2.12.388 Version/12.16
            [HTTP_ACCEPT] 
=> text/htmlapplication/xml;q=0.9application/xhtml+xmlimage/pngimage/webpimage/jpegimage/gifimage/x-xbitmap, */*;q=0.1
            [HTTP_ACCEPT_LANGUAGE] => fr-FR,fr;q=0.9,en;q=0.8
            [HTTP_DNT] => 1
            [HTTP_HOST] => www.mydomain.com
            [HTTP_COOKIE] => frontend=blr9u9vsesi7mdcpc9s5p7i2q2
            [HTTP_X_FORWARDED_FOR] => here is my ip
            [HTTP_SURROGATE_CAPABILITY] => varnish=ESI/1.0
            [PATH] => /usr/sbin/:/usr/bin/:/sbin/:/bin/
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache/2.4.6
            [SERVER_NAME] => www.mydomain.com
            [SERVER_ADDR] => some ip
            [SERVER_PORT] => 443
            [REMOTE_ADDR] => here is my ip
            [DOCUMENT_ROOT] => /srv/data/web/vhosts/www.mydomain.com/htdocs
            [REQUEST_SCHEME] => https
            [CONTEXT_PREFIX] => 
            [CONTEXT_DOCUMENT_ROOT] => /srv/data/web/vhosts/www.mydomain.com/htdocs
            [SERVER_ADMIN] => [no address given]
            [SCRIPT_FILENAME] => /srv/data/web/vhosts/www.mydomain.com/htdocs/index.php
            [REMOTE_PORT] => 56029
            [REDIRECT_URL] => /fr/customer/account/
            [GATEWAY_INTERFACE] => CGI/1.1
            [SERVER_PROTOCOL] => HTTP/1.1
            [REQUEST_METHOD] => GET
            [QUERY_STRING] => 
            [REQUEST_URI] => /fr/customer/account/
            [SCRIPT_NAME] => /index.php
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1377039113.6215
            [REQUEST_TIME] => 1377039113
        )

)

As you can see $_SERVER[’HTTPS’] is not turned on. So I removed the line from index.php and added instead :

if(isset($_SERVER['REDIRECT_HTTPS'])&& $_SERVER['REDIRECT_HTTPS'== 'on'{$_SERVER['HTTPS''on';}

But is it possible to fix this through htaccess file ? Something like :
SetEnvIf redirect_https HTTPS=on
???

Hope this will help magento user wink
 
Magento Community Magento Community
Magento Community
Magento Community
 
basante
Jr. Member
 
Total Posts:  8
Joined:  2013-09-11
 

Hello,

i try all your solution but no luck. any ideas? my ssl checkout not working, redirect loop error.
i can offer any details from admin panel, just let me know.

thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top