0

There is already a lot of links displaying videos inside my site (in node content) that are using:

http://example.com/clips/2017/01/11/51706, http://www.example.com/clips/2017/01/11/51706, https://example.com/clips/2017/01/11/51706, https://www.example.com/clips/2017/01/11/51706

So I want to standardize (make it uniform) all the my links to :

https://example.com/clips/2017/01/11/51706, https://www.example.com/clips/2017/01/11/51706

Redirecting the main URL works using .htaccess but the videos in the body of my articles that are HTTP are not affected so not displaying (I have a blank space instead )...

How can I make the internals links (the videos in the body of my articles) that are HTTP to redirect to HTTPS too?

Update
Videos are included using this embed code:

<div class="media_embed" height="300px" width="400px"><iframe allowfullscreen="" class="video-embed" frameborder="0" height="300px" scrolling="no" src="http://example.com/embed/clips/2017/01/11/51706" width="400px"></iframe></div>   

.htaccess

RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]     
  • How exactly do you include your videos? Through th me body field? How are they stored? – schlicki Feb 14 '17 at 22:47
  • Just to make sure, are your links in your content relative, eg. /clips/2017/01/11/51706 instead of http://www.example.com/clips/2017/01/11/51706 – rooby Feb 14 '17 at 22:48
  • @schlicki, I have my video in the cloud. I just add and the embed code which is in an iframe. I updated the question with the code. – mamesaye Feb 14 '17 at 23:02
  • @rooby, not all of them... I have a little bit of everything: relative, http, https but the problem is redirecting the http ones. – mamesaye Feb 14 '17 at 23:06
  • 1
    When setting up a redirect, you do it in the .htaccess file, telling your server to redirect all http links to https. You just need to uncomment the relative code .htaccess. Your links will still display as http, however when the user clicks on them, they will be redirected to https. If you want to have the links themselves be changed, you'll need to either go through and manually edit them, create a script that goes through and edits them, or create an input filter that changes http to https (then clear your cache). – Jaypan Feb 15 '17 at 3:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.