If you’re looking for innovation, results and a team of web, programming and multimedia experts for your business, feel free to contact us!
+91 836 953 8186

Near Ekta Society, Khairani Road, Sakinaka, Mumbai - 400072, India

Follow us on Social media

+91 8369538186

|

Mon – Sat 10:00 am – 08:00 pm

Follow us
Top

Redirect my website to HTTPS in cPanel/Linux

Redirect my website to HTTPS in cPanel/Linux

You are here:
< Back

If you have a secure certificate (SSL) on your website, you can automatically redirect visitors to the secured (HTTPS) version of your website to make sure their information is protected.

 

Linux-based accounts use .htaccess files to handle redirection.

If you do not have a .htaccess file:

Start by creating a .htaccess file in your public_html or webroot folder. Inside of the .htaccess file, you can use the following code to redirect visitors as long as you do not already have a .htaccess file set up:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?exampledomain\.com
RewriteRule ^(.*)$ https://www.exampledomain.com/$1 [R,L]

If you are hosting multiple websites on the same account, you will need to make sure that you have a .htaccess file set up in the directory of the website that has a SSL certificate issued.

If you have an existing .htaccess file:

  • Do not duplicate RewriteEngine On.
  • Make sure the lines beginning RewriteCond and RewriteRule immediately follow the already-existing RewriteEngine On.
Share
Quick Enquiry
close slider

\
0