Tuesday, March 30, 2010

Joomla Administrator force SSL login loop FIX

It took me A LONG time to find a solution on how to fix this problem. All credit for this fix goes to member:jptkts from http://forum.joomla.org.

This fixes the login loop issue when trying to login to the admin after making the Force_SSL to 1 or Administrator.

His original forum post is
http://forum.joomla.org/viewtopic.php?p=1619969#p1619969

I just wanted to re-post it in an easy to find place!

In the file: Joomlaroot/libraries/joomla/environment/uri.php
starting on line 214 replace this if statement:
Code:
if(JPATH_BASE == JPATH_ADMINISTRATOR) {
   $base['path'] .= '/administrator';
}

with the following:
Code:
if(JPATH_BASE == JPATH_ADMINISTRATOR) {
   $force_ssl = $config->getValue('config.force_ssl');
   if($force_ssl > 0){
      $base['prefix'] = ereg_replace("http://","https://",$base['prefix']);
   }
   $base['path'] .= '/administrator';
}


Stumble Upon CodePyro

6 comments:

Anonymous said...

THANK YOU! I WAS RIPPING OUT MY HAIR!

To clarify this issue for anyone who may need clarification - this issue arises when force ssl is set for admin only and $live_site (in configuration.php) is a non-https url. Note, if you don't have extensions installed which are making inappropriate use the $live_site variable, a better fix is to just set $live_site as an empty string and avoid making the core hack required. Unfortunately, several extension developers (some SEF components, for example) make liberal inappropriate use of the variable.

Ps. Its slightly more efficient and accomplishes the same thing to use str_replace rather than ereg_replace. Also, if you needed the regex functionality, you should use preg_replace as ereg_replace is deprecated.

THANK YOUR FOR POSTING THIS!!!

Anonymous said...

THANK YOU FOR POSTING! Finally a solution that works! Great job! Thanks again:-)

Anonymous said...

Thanks for posting that! Solved my problem neatly.

Jim

Sinelogix said...

Hello, Your Blog is so impressive and very informative. Thanks for sharing great Information.

Joomla Website Developer Bangalore | Joomla Web Development Bangalore | Internet Marketing Company in Bangalore | Joomla Web Design Company Bangalore

vé máy bay từ canada về việt nam said...

Mua vé tại đại lý vé máy bay Aivivu, tham khảo

vé máy bay đi Mỹ giá rẻ

ve may bay eva tu my ve vn

khi nào có chuyến bay từ canada về việt nam

đăng ký vé máy bay từ nhật về việt nam

Chuyến bay từ Hàn Quốc về Việt Nam

Vé máy bay từ Đài Loan về Việt Nam

ve may bay cho chuyen gia nuoc ngoai

Maria Bishop said...

I enjoyed reading thhis

Post a Comment