View Full Version : HTTPS in all IMG tag links?
DCD.RB
03-15-2017, 03:00 PM
Hi,
Is there a way to force all links posted in img tags from HTTP to HTTPS?
Thank you
Stratis
03-15-2017, 04:20 PM
Take a look here https://vborg.vbsupport.ru/showthread.php?t=323946&page=7
Just keep in mind that not all image hosts have support for HTTPS. If you rewrite these links to use HTTPS, it will break the image.
As Dave says you will break some images as some hosts to not have https, before doing any drastic rewriting, try adding an upgrade-insecure-requests (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests) header to your headinclude template and when you browse your forum with a compliant browser such as Chrome or Firefox then it will automatically request the https versions and you can get an idea of the impact that rewriting all the posted images to https will have.
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
DCD.RB
03-16-2017, 08:22 PM
Sorry, not sure if I'm entirely clear on this.
I only see search & replace query.
What I'm trying to do is when someone posts the code:
[ img ] http://image.com/image.jpg [ /i mg ]
It will automatically transform into an HTTPS link. I'm not concerned about the image being broken here, because the user should notice/realize immediately after when it doesn't properly display.
And for the most part, it seems 90%+ of the image hosts our users use does support HTTPS. They're just pasting in HTTP links, and adding the S has been a manual process I'd like to turn automatic if possible.
Kane@airrifle
03-16-2017, 09:33 PM
Maybe a replacement variable in Styles & Templates - Replacement Variable Manager?
[img]http:// to [img]https://
The caveat is that the urls would revert if you deleted the RV
DCD.RB
03-18-2017, 01:12 AM
Perfect, that works. Thank you!
Edit:
Spoke too soon, it will only convert the links upon editing the post, not when it's placed into the tags. Is there a better way?
--------------- Added 1489865677 at 1489865677 ---------------
Just to update, this worked for me:
https://vborg.vbsupport.ru/showthread.php?t=235769
--------------- Added 1489869070 at 1489869070 ---------------
Spoke too soon, that causes the same problem reported here: https://vborg.vbsupport.ru/showpost.php?p=1987417&postcount=5
webmastersun
04-10-2017, 12:52 PM
Hi,
Is there a way to force all links posted in img tags from HTTP to HTTPS?
Thank you
I don't see any problem with vB 4 when moving to https except sometimes uploading images to the forum is pretty difficult. Maybe I need a faster server.
This is making me to move to a dedicated server with more CPU cores.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.