If you have SSL certificate on your website. Then you can automatically redirect your visitor’s HTTP to HTTPS for a secure connection. In HTTPS ‘S’ shows that your communication is secure. But how to redirect HTTP to HTTPS?
For example:
In this link‘s’ shows that Arzhost website is secure.
There is nothing to do from your side. you enforce the site to use secure URL.
how to redirect http to https
For main domain enforce the SSL:
- Login to cPanel
- In domain side click on domains
- After click on domains page is open and you can see that there is an option you can enable or disable HTTPS redirect. you should leave to enable it. If there is no option to on it. Then SSL is not installed in your domain. Make sure that SSL is install or not if not installed then installed it.
If this section is on then your site is using HTTPS.
- Enforce the SSL for addon name.
- Linux using .htaccess files for redirection. you will need to create .htaccess file in your control panel file manager.
- In cpanel click on file manager.
- In file manager section click on setting.
- Ensure that show hidden file is check and save.
- Click on public_html
- In public_html click on .htaccess
If you have .htaccess file good. If you have not then click on file and name the file .htaccess and create it.
- Select the file .htaccess and click edit
- If you created .htaccess file, use this code for setup the URL redirect HTTPS version for your website.
<ifmudule mod_rewrite.c>
Rewriteengine on
Rewritebase /
Rewriterule ^index\.php$ – [ L ]
Rewritecond %{REQUEST_FILENAME} ! – f
Rewritecond %{REQUEST_FILENAME} ! – d
Rewriterule . /index.php [ L ]
</ifmodule>
- If .htaccess file is already exit then don’t make duplicate rewritrengine on.
- Ensure that lines start with rewriteenginecond and rewiteRule
- Save changes and close it. That’s all.