简体   繁体   中英

convert mix content http to https

I recently added a ssl certificate to my website. Now the problem is that some of the elements like images, fonts etc. are external content which is using http in "src=http://example.com/jpg" tag.

I know I can solve the problem by just replacing http with https in my elements tag but I have at-least 133 web-pages that will take a while to do it manually.

Is there any other alternative that I can use?

Can I use .htaccess for this problem?

note - I am using cpanel hosting

try this

RewriteEngine On

### WWW & HTTPS

# ensure www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

### WWW & HTTPS

.htaccess is not going to help you here as it is used for redirecting http to https in websites.

as you are using cpanel that means you dont have access to your root server therefore your only option is to manually convert http to https .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM