I created domain as http://www.example.com/ Now I bought a SSL for it. When I type https://www.example.com in address bar, it show my site in secure https. On other times, it didn't show https on my site.
Now I want to redirect to https from http. I searched on google. But someone say redirecting from http to https automatically is not a good idea. Someone says, you can redirect it like facebook, gmail. Now I'm confused.
Now I've more question on redirection,
1. May I redirect from http to https?
2. Is it safe or not?
3. have I face any problems in future for this redirect?
4. what is the secure way to redirect http to https?
My .htaccess file:
RewriteEngine On RewriteCond %(REQUEST_FILENAME) !-d RewriteCond %(REQUEST_FILENAME) !-f RewriteCond %(REQUEST_FILENAME) !-l] RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] Updated
I add following to my .htaccess. It redirect well and working fine. But now I get new problem. I can't access inseure content in my page. My .htaccess file is:
RewriteEngine On RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE] RewriteCond %(REQUEST_FILENAME) !-d RewriteCond %(REQUEST_FILENAME) !-f RewriteCond %(REQUEST_FILENAME) !-l RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] It display errors " [blocked] The page at 'https://www.example.com/red-ball-4-game' was loaded over HTTPS, but ran insecure content from 'http://www.sample.net/img/olume.jpg': this content should also be loaded over HTTPS.
"
How to solve this?