Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-09-12 07:52:57

kimass
New Member
Registered: 2019-09-12
Posts: 8

Site images not showing up with https

My web site stopped showing some images after switching from http to https. Service provider sent me an email that I have to fix .htaccess file to show the images. Here is a part of code:

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] #RewriteBase /relative/web/path/

RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www.)?example.com/.*$ [NC]
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ RewriteRule .(gif|jpg|png)$ – [F]

Any idea?

Last edited by kimass (2019-09-12 10:50:21)

Offline

#2 2019-09-12 12:03:22

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Site images not showing up with https

Hi, welcome to the forum.

Normally, image URL generated via txp tags should use https, but hardcoded (via Textile or HTML) images URL need to be redirected to https.

The solution depends on your server configuration. Try googling for htaccess redirect http https to check if something works for you.

Offline

#3 2019-09-12 12:30:10

kimass
New Member
Registered: 2019-09-12
Posts: 8

Re: Site images not showing up with https

Hi, thank you.

I’ve been trying since yesterday, with no success.

Server is Apache, I have c panel, and few wordpress websites at the same provider. But this is my first textpattern and I wouldn’t like to make a mess.

Offline

#4 2019-09-12 12:49:32

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Site images not showing up with https

Hi kimass
and welcome to txp
Did you try the htaccess code here?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2019-09-12 14:41:20

kimass
New Member
Registered: 2019-09-12
Posts: 8

Re: Site images not showing up with https

Hi colak,
thanks!

do you mean this:
——————————————————————————————-
RewriteEngine on

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
———————————————————————————————

And where exactly to put it?

Offline

#6 2019-09-12 17:40:46

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Site images not showing up with https

kimass wrote #319275:

Hi colak,
thanks!

do you mean this:

RewriteEngine on

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

And where exactly to put it?

That is what I meant:) You can copy paste it on top of your htaccess in the root directory of your txp site. If your server misbehaves just delete it and we’ll try to find another snippet for you.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2019-09-12 18:23:01

kimass
New Member
Registered: 2019-09-12
Posts: 8

Re: Site images not showing up with https

I’ve put it on the top of the .htaccess but nothing.

Offline

#8 2019-09-12 18:49:55

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 307
Website GitHub GitLab Twitter

Re: Site images not showing up with https

I always prefer conditional links, not absolute:

/my-webpage or "link":my-webpage — internal, and
//domain.tld/link — external links.

Warning: this method is not suitable for linking from own encoded to external plain URLs (https to http).

Offline

#9 2019-09-13 04:34:55

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Site images not showing up with https

Hi kimass,

could we have the url of your site in order to experience the behaviour your describe?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#10 2019-09-13 06:42:43

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Site images not showing up with https

Also check out this post as we need to define the https protocol in the config.php file


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#11 2019-09-13 06:47:26

kimass
New Member
Registered: 2019-09-12
Posts: 8

Re: Site images not showing up with https

Url
https://www.servisracunara.co/

Thank you

Offline

#12 2019-09-13 08:16:35

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Site images not showing up with https

I see all the images in your site. Can you point me to a page where the images do not load?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB