Skip to main content
Help Center
The GoDaddy Community will undergo maintenance starting on Wednesday, July 28th at 3pm PST / 6pm EST. Learn more
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Redirect website to HTTPS in cPanel/Linux

I was able to successfully create the HTTPS URL for my website but the redirect from HTTP still not working. It still comes up as unsecured.  I inserted the code below into my .htaccess file and changed the coolexample to my dns.


Is there something else I need to do to get the redirect working? 


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



I was able to get mine working with what you have down there but I don't have your 2nd line in mine. 
Mine looks like:

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]


Make sure that if your .HTACCESS file already had stuff in it that you put it where it belongs. Mine already had the rewriteengine on and some other code in there, so you need to drop it between:


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$$1 [R,L]

# END WordPress

 Please note I put it between the <IfModule>   </IfModule> tags, otherwise it's just text.