SSL / https updating to this - problems

Started by nax, July 04, 2019, 12:09:26 PM

Previous topic - Next topic

nax

Hi I'm using SMF 2.0.15 and I have an SSL certificate installed on my server. I followed the instructions to upgrade to https
https://www.simplemachines.org/community/index.php?topic=555034.msg3934593#msg3934593

and completed one site successfully but my own site is having problems with paths to directories. PLease see the attached I really could do with some help here.

shawnb61

Are the contents of the directories OK?   

What are the file permissions on the files in those directories?

Did you move/relocate folders or do any other actions?  Or were you just converting to https in-place? 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

nax

I was just converting in place the permissions on /public_html/funforest/Smileys is 755 the forum has been working fine up until me trying to enforce https

nax

the .htaccess looks ok here's the start of it.

RewriteEngine on

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 95.211.132.70
deny from 93.158.151.25
deny from 93.100.188.220


I try loading an image
https://www.naxfun.com/funforest/Themes/brightforest_23/images/off.gif and I get an error but if I try http: it works

http://www.naxfun.com/funforest/Themes/brightforest_23/images/off.gif

and https is set for this location in repair_settings (see the attachment) - I'm foxed.


nax

Same with smileys https doesn't work but loading in a web page using just http loads the image the setting in repair_settings.php is

Smileys URL:   
https://www.naxfun.com/funforest/Smileys
Recommended value: "https://www.naxfun.com/funforest/Smileys".

The path on the server is /public_html/funforest/Smileys/ and I changed the permissions on this file to 777 but it made no difference

drewactual

RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.naxfun.com/$1 [R=301,L]

use that one^, which forces WWW too... it may or may not straighten out your other issues, but it eliminates the issue of two different SSL domains (https://www and opposed to just https:// )

also.... dump your cache- all of it.  restart apache if you can in the case OPCache is running, too. 

nax


drewactual

i edited the post above- about cache.

i see there are still a bunch of calls to http:// hard coded in your index.template.   the easiest thing to do, in my humble opinion, is to open the index.template in your cpanel editor and search for http://, and paste https:// in its place... save it.  do it for the major ones which include (in your default theme if it isn't in your custom theme's directory) boardindex.template, messageindex, and display.  do the swap for https on each one of the images (and hit the links, too)  DON'T change the declaration to (xhtml) to https, leave it http- otherwise change them all. 

it appears to me your code is calling for http and if so that htaccess ain't gonna help you. 

if it were me, i would replace every call to image or INTERNAL link using short relative code as opposed to full URL's... example:


src="http://www.naxfun.com/dimages/btn_donateCC_LG.gif"


is the same as:

src="/dimages/btn_donateCC_LG.gif"


and the magic in using it? ^ is the htaccess entry you have will push it to https, AND, it's one less call your page makes through the server just to come back to you and retrieve it before sending it to the user...

if you're going multiple directories up, use:
src=".././dimages/btn_donateCC_LG.gif"
or two directories up use:
src="././dimages/btn_donateCC_LG.gif"
or just one:
src="./dimages/btn_donateCC_LG.gif"

but the point is to lose the: hxxp://www.naxfun.com/ part so the images, links, whatever, are being called by the relative httpS and www...

Kindred

if it is an approved theme, there should be NO hardcoded image links....

if that is the case, then it indicates that the actual theme directories are still http, not https in the theme settings
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

nax

It looks like the image and smileys directories are at http not https but repair_settings is showing it at https as is Funforest > Administration Center > Themes and Layout > Theme Settings

Bright Forest (2.0)
Theme directory (templates):/home/naxfunco/public_html/funforest/Themes/brightforest_23
URL to above directory:https://www.naxfun.com/funforest/Themes/brightforest_23
URL to images directory:https://www.naxfun.com/funforest/Themes/brightforest_23/images

any idea why these directories are not picking up the https setting?

drewactual- the images you are quoting I know about and will resolve in due course once this major issue is resolved.


drewactual

did you dump your cache and restart apache (or at least clear OPCache if you're using it)? 

it seems a lot of these issues that pop up are often cache issues.   dump your browsers cache, too...

shawnb61

I hate to say this, but...  Often the problem with repair_settings is not hitting the SAVE button...   ;D
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

nax

Defo hit the save and also re ran it to check.  Just been into again all paths showing as https: no change.

vbgamer45

Hmm might be hardcoded.
I recommend using this site to check for issues
https://www.whynopadlock.com/
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

nax

Hi Vbgamer, the errors reported by that site refer to some rotating images I have on my home page / template and my donate button.  Smileys are not working and are global not hard coded.

vbgamer45

Looks like maybe bad .htaccess rules or default images not uploaded.

No images are loading from which is why your forum is messed

https://www.naxfun.com/funforest/Themes/default/images/

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

nax

Thanks guys I think you are pointing me in the right direction, I tried simple .htaccess file in my forum folder and I got the theme images back and my smileys.  I reloaded the .htaccess file in the root of the www folder and examined it.  Far down in a lit of deny statments I found the following:-

deny from 77.239.224.0/21
deny from 79.111.128.0/17
RewriteCond %{HTTP_REFERER} !^http://naxfun.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://naxfun.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.naxfun.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.naxfun.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|mp3)$ - [F,NC]

Not really sure what they are but I changed the redirect to https: -
deny from 77.239.224.0/21
deny from 79.111.128.0/17
RewriteCond %{HTTP_REFERER} !^https://naxfun.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://naxfun.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.naxfun.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.naxfun.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|mp3)$ - [F,NC]

That seems to have partially solved the problem, my background logo still needs to be addressed.

I notice that in SMF Admin/configuration, when I click on Current Theme it takes me to Themes and Layout - is this correct.  It's not just my site but a site I upgraded to https earlier.

vbgamer45

Anything that is still broken on your forum?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

nax

No all looks well but I'm still questioning the action ............

I notice that in SMF Admin/configuration, when I click on Current Theme it takes me to Themes and Layout - is this correct.  It's not just my site but a site I upgraded to https earlier.

Otherwise all seems ok  :D

vbgamer45

Not it should go to a settings page. Unless you changed how it works in Sources/Admin.php
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: