none

How to force redirect HTTP to HTTPS?

HTTPS and SSL

Back to support

How to force redirect HTTP to HTTPS?


To redirect all traffic from HTTP to HTTPS , you have to create a .htaccess file under public_html directory and put some line of codes within the file.


You can do that easily via cPanel File Manager.


First of all Log into your cPanel and search for File Manager under FILES section.


htaccess1.png



In the File Manager window that opens, click the Settings button at the top right of the page.


settings.png



In the Preferences panel that opens, ensure Show Hidden Files (dotfiles)Show Hidden Files (dotfiles) is checked and click Save.


hidden-files.png



Now use the folder tree in the left sidebar to navigate to the root of your website. Check to see if a file named .htaccess already exists. It can be created by default when you install popular CMS packages like WordPress, Drupal or other web apps.


htaccess1.png



If you do not see a .htaccess file, at the top of the page, click + File. In the panel that opens, under New File Name, enter .htaccess and click Create New File.


htaccess3.png



Otherwise, highlight the .htaccess file with a left-click and, Right click, select Edit. If you’re asked to confirm encoding, click Edit once again.




The cPanel text editor will now open. If you are creating a new .htaccess file, you’ll see a blank page. However, existing files may already include a set of rules,


Enter the following code in your .htaccess file:


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


Click Save Changes to complete the redirection.



googiehost support

Still have questions? Check our