Reputation: 37
I have hosted an ecommerce website with the OpenCart script at www.medicosales.in
I am facing some errors.
The website when opened by typing medicosales.in is NOT automatically resolving to https:// where I have seen in SSL secured sites that just by typing yourdomain.com the URL automatically takes https://
It's showing this message
How to solve it?
Upvotes: 0
Views: 36
Reputation: 2985
.htaccess
file if you're using Apache, or similar if you're using another webserver to rewrite your URLs to include https://
if they do not already. This will force the user's browser to access via the correct protocol.For Apache place the following code into the top of your .htaccess
file in your document root for the site ensuring mod_rewrite
is enabled.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<img src="http://example.com/myimage.jpg" ...
you must ensure that the protocol is HTTPS also otherwise your browser will give you that message since the resource was not loaded securely.The way to fix this is ensure that all externally linked resources have their URLs prefixed with //
and not http://
. This way the browser will use the current protocol to fetch the resource.
Thanks @davidgiga1993 for pointing out //
rather than using https://
Upvotes: 2
Reputation: 1885
It is not automatic. You need to send a 302/301 redirect back to the user pointing to the https URL.
Upvotes: 0