Posted in
(Primary)Website Troubleshooting,
Redirect domain from www or http to https with .htaccess file
Updated at 30 Oct 2025 09:02
by Administrator
Hi,
If you just created your .htaccess file, use the following code to set up the URL redirect to the HTTPS version of your website:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80 [OR]
RewriteCond %{HTTP_HOST} ^www\.yourDomainName\.com [NC]
RewriteRule ^(.*)$ https://yourDomainName\.com/$1 [R=301,L]
If your .htaccess file already exists in your hosting account, do not duplicate ReWriteEngine On. Insert the lines that begin with ReWriteCond and RewriteRule directly after the already existing ReWriteEngine On.
You may also check the Redirect feature on their cPanel account too. If it already set the redirect and you add a rewrite rule on their .htaccess file, it will overlap to each other.
Sorry for the inconvenience.
Posts in Category
-
Images are not display on my website
Admin Updated on 30 Oct 2025 09:02
-
Website favicon is not showing on iOS mobiles
Admin Updated on 30 Oct 2025 09:02
-
Website logo is not showing on Mobile
Admin Updated on 30 Oct 2025 09:02
-
I got "Warning your password has expired." when going to edit website
Admin Updated on 28 Sep 2026 09:27
-
Make website to be able to be called with www on browser
Admin Updated on 30 Oct 2025 09:02