cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution
Highlighted
New

Redirect a web site

I have a simple HTML web site that I have added an SSL certificate. I have added the following code to the .htaccess file with my domain name.

 

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

 

The code does redirect to a simple page that has a link to the web site. My question is, will this change over time and go right to the site or is there something else I have to code to get the redirect right to my website? Also, do I need to set the R to R=301?

 

If anyone can help, I would appreciate it.

Thank you,

R

7 REPLIES 7
Super User I
Super User I
Solution

Re: Redirect a web site

Hello and thank you for reaching out to the GD community page where GD users help each other.

Check out this GD article: https://www.godaddy.com/help/redirect-my-cpanel-website-to-https-27870?

Or the article: https://www.godaddy.com/help/redirect-my-wordpress-website-to-https-for-cpanel-hosting-27871?

Let us know if this helps you!

Very Respectfully,

Drew Davis
Navy Veteran and Entrepreneur | GoDaddy Pro user | "Proud to be serving others!"

*** Please note that I offer free advice on this forum. Please feel free to give me KUDOS on this topic/discussion; mark my comment as ACCEPTED SOLUTION if you believe I've helped solved your issue. Thanks! ***
New

Re: Redirect a web site

Thank you davisdre317 for the reply to my post. The first article I used for my website because it is a simple HTML website. The other article I did not use because It referred to word press. I am trying to figure out if I need to add anything else to the code in the .htaccess file, so that when some one searches for my web site on, Google, Bing etc that they are not redirected to a a "Found page - The document has moved here" page. I want to have the link go straight to the web site and not to a Found page.

If there is no code to add, will the browsers in the future just automatically redirect to the site without going to the Found page.  

 

Any help would be appreciated.

R

Super User I
Super User I

Re: Redirect a web site

@rj851 you should be good then. It can take a few for SEO crawlers to come around and update there database.

Very Respectfully,

Drew Davis
Navy Veteran
Blog: www.davisdre.com

Very Respectfully,

Drew Davis
Navy Veteran and Entrepreneur | GoDaddy Pro user | "Proud to be serving others!"

*** Please note that I offer free advice on this forum. Please feel free to give me KUDOS on this topic/discussion; mark my comment as ACCEPTED SOLUTION if you believe I've helped solved your issue. Thanks! ***
New

Re: Redirect a web site

Thank you again davisdre317 for your quick reply.

One last question: Is it best to leave it as it is, or should I change the [R,L] to [R=301, L].

I have been reading that the way I have it now is temporary where 301 is permanent. Is there a difference or should I leave well enough alone. Some say it does not matter.

 

Thanks for all your help.

R

Super User I
Super User I

Re: Redirect a web site

Your welcome @rj851

My opinion, I don't think it will matter.

Very Respectfully,

Drew Davis
Navy Veteran
Blog: www.davisdre.com

Very Respectfully,

Drew Davis
Navy Veteran and Entrepreneur | GoDaddy Pro user | "Proud to be serving others!"

*** Please note that I offer free advice on this forum. Please feel free to give me KUDOS on this topic/discussion; mark my comment as ACCEPTED SOLUTION if you believe I've helped solved your issue. Thanks! ***
New

Re: Redirect a web site

davisdre317

 

You have been a great help. I appreciated all the information you have given me.

 

Thank you,

R

 

Re: Redirect a web site

The offered solution works only in 3 of 4 cases:

  1. mydomain.com redirects to https://www.mydomain.com, so no problem
  2. www.mydomain.com redirects to https://www.mydomain.com, so no problem
  3. https://www.mydomain.com IS https://www.mydomain.com, so no problem
  4. https://mydomain.com does not redirect and gets a security error, so this is a problem

 

I suspect the problem is because coming from https in #4 does not meet the port condition (port 443, not port 80)

 

How do I get around this, short of buying more certificates so I can secure both the domain by itself and also the domain with the www subdomain (e.g, mydomain.com & www.mydomain.com)??????????????????????