The code Below is to Force all traffic of your website from HTTP request to HTTPS using .htaccess file once you have configured your SSL. Open your .htaccess file located on root of your web directory. If not shown in the files then change setting to view hidden files in web directories (shown image below).
Add following lines to your .htaccess file under <IfModule mod_rewrite.c> tag.
RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Now check your website by entering http://domain.com, you will see your website is redirected to https:// protocol.
Hope this help!
Posts you may like:
2 comments
Yes! Finally something about website.
Excellent way of telling, and fastidious piece of writing to take information about my presentation subject matter, which i am going
to deliver in college.