cancel
Showing results for 
Search instead for 
Did you mean: 

Luma theme home page messed up upon https

Luma theme home page messed up upon https

I am using Magento 2.1.9 and standard Luma theme, the http:// site works fine. but when i setup ssl and using https:// access, the home page is messed up and the sub-pages all Not found!

 

I check from ssllabs, my certs is fine.

 

i guess if it's an issue with the rewrite? if yes, how should i modify the rewrite?

 


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=
I'm always a child when talking about knowledge.
5 REPLIES

Re: Luma theme home page messed up upon https

Hi @dennischan

 

there might be a multiple reason for this.

 

like wise - you need to change base url and base url secure to https

 

second thing as mention by you , yes possible chance of rewrite mode issue.

 

third thing is permission ,kindly check permissions of your directories and files.

 

last but important thing is , run php bin/magento setup:static-content:deploy -f command then check.

if issue solved,Click Kudos & Accept as Solution

Re: Luma theme home page messed up upon https

Dave,

Thanks for your suggestion, I can tell you not working.

You can have a look.

http://www.security-warehouse.com/ is working

but

https://www.security-warehouse.com/

the style failed to load

i have checked by inspector, it says some js could not be loaded.

but actually they are the same between http and https (i guess)

any idea appreciated.

 


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=
I'm always a child when talking about knowledge.

Re: Luma theme home page messed up upon https

Hi @dennischan

 

okay - i understand.

 

I have checked both the links which you have shared with us and looks like css and JS are not loading on the secure site.(https)

 

Can you please check that pub directory have writable permission ?

 

Also have you run static-content:deploy command ? if not please run - php bin/magento setup:static-content:deploy command

 

Refer this link for more details - https://magento.stackexchange.com/questions/97209/magento-2-css-and-javascript-not-loading-from-corr...

 

if issue solved,Click Kudos & Accept as Solution

Re: Luma theme home page messed up upon https

Dave,

 

Thanks for your detailed sharing of idea, but no luck, it's still the same.

 

I wonder what makes the difference between https and http loading the same page? 

 

Is that the rewrite rule?

 

I have searched for a while, no any mention on this.

 

inside my site.conf

---

AllowOverride All
RewriteEngine On
RewriteBase /
#RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !^/(media|skin|js|download)/
RewriteRule . index.php [L]
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

---

 

 

and inside my pub/static, the .htaccess includes

--

RewriteEngine On

RewriteBase /pub/static
# Remove signature of the static files that is used to overcome the browser cache
RewriteRule ^version.+?/(.+)$ $1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* ../static.php?resource=$0 [L]

---

 

could you think of something possible?


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=
I'm always a child when talking about knowledge.
Highlighted

Re: Luma theme home page messed up upon https

@dennischanIf you'll look at the CSS/JS URL's of HTTPS page via view source in browser you'll notice that you are missing 'pub/static'. That is what causing the issue in HTTPS.

 

I believe you have already tried deploying static content. I would recommend to delete the cache files and static files via command line. Deploy the static content again. If that does not work then you need to look into the server configuration is see what is missing for HTTPS which is there for HTTP.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

Thanks,
Tarandeep
Magento 2 Certified Solution Specialist (x2). Follow me on Twitter