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

creating an .htaccess file

I have just been issued a standard SSL certificate and am trying to understand the "Redirect" instructions. (I am using the Linux or cPanel type).  I have a couple questions from GoDaddy's instructions.

Do  I create this file, ".htaccess", in my primary file:     /home/myfilename/public_html

 

The code suggested for the new file is:

Rewrite Engine ON
Rewrite Cond %{HTTPS} off
Rewrite Rule ^(.*)$ https://%(HTTP-HOST)%{Request-URI} [L,R=301]

 

Does my website name "www.victorytrinitylutheranchurch.org" appear within the code?

 

I am obviously new at this and am not quite sure after reading the instructions.

 

Thank you for any help.

 

1 ACCEPTED SOLUTION
Helper VI

@Ordway let me explain you how to do it:

  1. From your cpanel file manager, go to the root folder of your website (ie. public_html).
  2. Check that the (dot)htaccess file does not exist. If exists, skip to step 4.
  3. Create the (dot)htaccess file, by clicking on the top left menu
  4. Right click on the file and edit.
  5. Paste the code at the top of your file, and click save.
  6. Check that the redirect works
Rewrite Engine ON
Rewrite Cond %{HTTPS} off
Rewrite Rule ^(.*)$ https://%(HTTP-HOST)%{Request-URI} [L,R=301]

It doesn't have to have your domain name, since it's handled by the HTTP-HOST directive.

 

Hope it helps!

If you find my replies helpful, give me a like or kudo 🙂
And if I solved your issue, mark it as solution 😄

View solution in original post

9 REPLIES 9
Helper VI

@Ordway let me explain you how to do it:

  1. From your cpanel file manager, go to the root folder of your website (ie. public_html).
  2. Check that the (dot)htaccess file does not exist. If exists, skip to step 4.
  3. Create the (dot)htaccess file, by clicking on the top left menu
  4. Right click on the file and edit.
  5. Paste the code at the top of your file, and click save.
  6. Check that the redirect works
Rewrite Engine ON
Rewrite Cond %{HTTPS} off
Rewrite Rule ^(.*)$ https://%(HTTP-HOST)%{Request-URI} [L,R=301]

It doesn't have to have your domain name, since it's handled by the HTTP-HOST directive.

 

Hope it helps!

If you find my replies helpful, give me a like or kudo 🙂
And if I solved your issue, mark it as solution 😄

View solution in original post

Thanks jpablo for your reply.  I thought I was over complicating the instruction  but wanted to be certain.

I got as far as creating the file using "+ File" but once I entered the name it does not appear anywhere in the "public_html" directory in order to edit and enter the script.  I have refreshed the file a couple times but the new ".htaccess" file appears nowhere.

If I search for it I find "public_html/.htaccess" appears in the results with the "/.htaccess" as a second line.

 

Any idea on what is going on now?

i have created the .htaccess file in public_html folder in cpanel but the file is not visible after creation so that i can edit it any solution

Fourbridges123,

 

That happened to me also. If you are using CPanel go to "Hosting" and there is a menu bar in the green area . Select the "file manager" option from there.  I was told by GD techs when using the file manager icon version it will not display hidden files. The file manager option in the task bar menu does.

 

Good luck.

Thanks a lot sir, i found my file.

Hi Pablo -- I'm having the same challenge as the original poster.  I've located the .htaccess file okay and edited it with the code you provided and which I had found in a help screen on this topic.  But now I'm getting an error message when I try to access my page: 

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@stagfilmhistory.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

 

The code in my .htaccess file is this:

 

Code.jpg 

Can you or someone else spot the problem and advise what to do?

I recently had an issue as well. My CPU usage would go through the roof! I first thought it was a hotlink attempt but I went ahead and completely deleted my .htaccess file. I made a new one, pasted the following code but I am receiving the 500 Internal Server Error as well.

 

Rewrite Engine ON
Rewrite Cond %{HTTPS} off
Rewrite Rule ^(.*)$ https://%(HTTP-HOST)%{Request-URI} [L,R=301]

I recently added an SSL certificate to my website. I now need to redirect all standard http requests to the new https designation. Google states that in order to do this without causing issues with already established Google page rankings I will need to do a 1 for 1 move. If my website has 754 pages then I will need to do a separate 301 redirect for each page individually (754 separate 301 redirects). I've spent the last 15 years and a ton of money getting my SEO to the point that I'm on page 1 of Google searches for most key phrases that relate to my business. My website pulls in $6.5M in revenue every year so obviously doing anything that may cause fluctuations in my page rankings is a nightmare scenario for me therefore I don't mind taking the time to do the 754 separate 301 redirects if that will keep things in order. Any assistance that anyone can offer would be greatly appreciated.

 

Here are a few of the things that I've tried. None of them seem to have worked.

 

 

Redirect 301 http://trailershowroom.com/5x8sal.htm https://trailershowroom.com/5x8sal.htm

 

 

Redirect 301 /5x8sal.htm https://trailershowroom.com/5x8sal.htm

 

 

Redirect 301 www.trailershowroom.com/5x8sal.htm https://trailershowroom.com/5x8sal.htm

 

 

Redirect 301 trailershowroom.com/5x8sal.htm https://trailershowroom.com/5x8sal.htm