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

restore my .htaccess file

Hi  -- I've recently purchased an SSL certificate and was given a pointer to a page that would help me edit my .htaccess file to redirect traffic to the HTTPS address:

 

https://my.godaddy.com/help/redirect-http-to-https-automatically-8828

 

I followed the directions in CPanel -- or I thought I had -- but when I saved the changes and visited my site, I got a ' 500 Internal Server Error error'.  

 

Here's a picture of the code in my .htaccess file -- I thought I only edited the bottom 3 lines per the instructions, but maybe I messed something up or am just missing some detail?

 Code.jpg


 

Can you or someone else spot the problem and advise what to do? I'm afraid I'm really not knowledgeable about coding so I have no idea where to go now.  

1 ACCEPTED SOLUTION

Okay, now that I look a little closer... the first 3 lines (each bounded with curly braces { and } ) shouldn't be in your htaccess file.  Those look like they're data for an RTF (Rich Text Format) page.

 

Copy that file (to your PC if you can) to have for reference... then remove those 3 lines with the curly braces.  In fact, I don't think ANY of the lines (the ones with backslashes \ ) are supposed to be there. Try just leaving the 3 lines starting with "Rewrite" and see what happens.

 

I've only used htaccess in a WordPress context... my early experience is on Windows hosting!

Ray

Not a GoDaddy employee or support staff; I am a GoDaddy Pro with significant experience using a variety of GoDaddy services.

View solution in original post

4 REPLIES 4
Helper I

Hey, @8martini8,

 

I couldn't see the file you attached here... but I went back and looked at what you posted yeserday.  Looks to me like there is a backslash at the end of the "RewriteEngine On" line.  I'm no htaccess expert... but take a look at that and if it's really there, remove it and see if that fixes it.

 

Ray

Not a GoDaddy employee or support staff; I am a GoDaddy Pro with significant experience using a variety of GoDaddy services.

Actually, I noticed that and removed the slash and still no go.  Actually, now I removed that apparently it's allowing me to post the code here, so this is what I've got in there.  Everything above the last three lines was just there already.  I created my web-pages in Dreamweaver, which is a WYSIWYG program, so I've never been "under the hood" for this stuff....

 

{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf200

{\fonttbl\f0\fmodern\fcharset0 Courier;}

{\colortbl;\red255\green255\blue255;\red199\green232\blue255;\red13\green19\blue31;}

{\*\expandedcolortbl;;\cssrgb\c81961\c92941\c100000;\cssrgb\c5882\c9804\c16471;}

\margl1440\margr1440\vieww10800\viewh8400\viewkind0

\deftab720

\pard\pardeftab720\partightenfactor0

 

\f0\fs28\fsmilli14400 \cf2 \cb3 \expnd0\expndtw0\kerning0

RewriteEngine On

RewriteCond %{HTTPS} off

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

Okay, now that I look a little closer... the first 3 lines (each bounded with curly braces { and } ) shouldn't be in your htaccess file.  Those look like they're data for an RTF (Rich Text Format) page.

 

Copy that file (to your PC if you can) to have for reference... then remove those 3 lines with the curly braces.  In fact, I don't think ANY of the lines (the ones with backslashes \ ) are supposed to be there. Try just leaving the 3 lines starting with "Rewrite" and see what happens.

 

I've only used htaccess in a WordPress context... my early experience is on Windows hosting!

Ray

Not a GoDaddy employee or support staff; I am a GoDaddy Pro with significant experience using a variety of GoDaddy services.

View solution in original post

Thanks a million Ray -- that did it!

 

I think what happened was I followed directions for creating the file on my iMac using textEdit -- but the directions didn't tell you what format to save it in, so it was rtf by default.  Removing all but the three lines worked!

 

I really appreciate your taking the time to help her.