WebsiteBaker Community Forum

WebsiteBaker Support (2.12.x) => General Help & Support => Topic started by: netraam on January 18, 2020, 05:28:59 PM

Title: can not login after switching to SSL
Post by: netraam on January 18, 2020, 05:28:59 PM
Hello,

Our hosting company has set SSL on our website. They warned me that it was possible that I have to change something in the CMS. But now I can't login anymore. Does someone know how I can solve this problem.

thanks,
Maarten
Title: Re: can not login after switching to SSL
Post by: johnbroeckaert on January 18, 2020, 06:02:57 PM
Hello,

try to go to the root of your website with FTP software and change the config file
Code: [Select]
define('WB_URL', 'http://localhost:4001/wbdemo'); // no trailing slash or backslash!!into
Code: [Select]
define('WB_URL', 'https://localhost:4001/wbdemo'); // no trailing slash or backslash!!That would do it....
Title: Re: can not login after switching to SSL
Post by: johnbroeckaert on January 18, 2020, 06:06:03 PM
You can force an HTTPS connection on your website by adding these rules in your website's .htaccess file:
   
Code: [Select]
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

The .htaccess file needs to be located inside the site's document root folder. If your website is in a sub folder, then the .htaccess should be placed in the corresponding sub folder.

You can create or edit the .htaccess file either via FTP, or using with the File Manager available in cPanel.
Title: Re: can not login after switching to SSL
Post by: netraam on January 18, 2020, 06:45:44 PM
thanks for the fast reply,

the url in the config.php was already https.
I've put the rules in the htaccess and now everything works fine.

When changing the htacces I've accedentaly deleted the content of the htaccess.
Are there other things that need to be in the .htaccess? Now I have only the three lines that you posted.
Title: Re: can not login after switching to SSL
Post by: johnbroeckaert on January 19, 2020, 04:27:11 PM
that depends on what was arranged. For example 404 error or 302 references from old to new pages;
This is useful for recording as standard:
Code: [Select]
ErrorDocument 404 http://www.domain.com/index.phpwhere domain.com is your own domain.