3

I've activated SSL for the whole Magento store and it works perfectly on the frontend, but the issues I'm having is with the admin.

Once enabled, I can't access it.

Before I had an issue with ERR_TOO_MANY_REDIRECTS and fixed it by adding to my .htaccess this:

RewriteCond %{HTTPS} off
RewriteRule ^ https://domain.com%{REQUEST_URI} [R,L]

And it fixed the redirect issue. But now I can't use it because the site is broken.

I suppose the issue is because, the CSS/JS are still being loaded via HTTP.

How can I change it (manually or programmatically)?

UPDATE:

Is there a way to simply ignore the Admin(backoffice)?

If I set: Unsecure to https it automatically does apply the config for admin as well... It ignores the setting in Secure -> Use Secure URLs in Admin -> No

Could it be Re-Indexing problem?

2 Answers 2

7

This issue is probably being caused because the admin portal is attempting to load the javascript and css files via normal http, as opposed to https.

To correct this, please try to set Use Secure URLs in Admin to true, in System -> Config -> General -> Web.

UPDATE In Magento 2.4:

To correct this, please try to set Use Secure URLs in Admin to true, in Stores -> Configuration -> General -> Web.

This should solve your problem.

6
  • Hello David, Thank you for your input. In my database i have: scope_id: 1, web/secure/use_in_adminhtml 1 and enabled in the backend... Still giving me problems...
    – Artur Rain
    Commented Sep 30, 2015 at 15:39
  • When you open F12 developer tools and visit console, are you getting insecure or mixed content warnings? If so, is it for the files that aren't loading? Commented Sep 30, 2015 at 15:40
  • Also, did you apply that rule to .htaccess before or after you set the secure url rule in Admin? What about using secure URLs in frontend? Was that checked before or after your htaccess rule? Commented Sep 30, 2015 at 15:41
  • I can't tell, before or after. Can you tell me when it should be done? I do the following: Go to admin and set the SLL for frontend (unsecure and secure), then apply uncomment the .htaccess rule and manually clean all var/cache and var/sessions And yes, I get mixed content (insecure) warning's in the frontend, because I need to revise all my links and images in the content. But first I want to fix this :) Thanks for your input. Realy appreciate it.
    – Artur Rain
    Commented Sep 30, 2015 at 16:06
  • Does it actually say https://domain.com in your .htaccess file? Or did you replace your actual domain with domain.com? Commented Sep 30, 2015 at 16:20
0

This is an update post for David Lerned answer.

In Magento 2.4 there where a couple layout changes including the settings now being under Stores instead of System: Stores -> Configuration -> General -> Web

There are a couple settings that could be causing the issue:

  1. Auto-Redirect to Base URL is ON. This setting redirects the base url to the www version of it which can cause issues if a www version doesn't exist. Find this setting in Url Options.
  2. Check that Use Secure URLs on Storefront and Use Secure URLs in Admin are both off. Find this setting in Base URLs (Secure).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.