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
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.
-
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– Artur Rain2015年09月30日 15:39:17 +00:00Commented 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?David Lerner– David Lerner2015年09月30日 15:40:02 +00:00Commented 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?David Lerner– David Lerner2015年09月30日 15:41:18 +00:00Commented 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– Artur Rain2015年09月30日 16:06:34 +00:00Commented Sep 30, 2015 at 16:06
-
Does it actually say
https://domain.comin your .htaccess file? Or did you replace your actual domain with domain.com?David Lerner– David Lerner2015年09月30日 16:20:58 +00:00Commented Sep 30, 2015 at 16:20
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:
Auto-Redirect to Base URLis ON. This setting redirects the base url to thewwwversion of it which can cause issues if awwwversion doesn't exist. Find this setting inUrl Options.- Check that
Use Secure URLs on StorefrontandUse Secure URLs in Adminare both off. Find this setting inBase URLs (Secure).
Explore related questions
See similar questions with these tags.