Using .htaccess Files on www.godaddy.com

 

     My wife recently bought a domain name, www.lorraineprofeta.us, and hosted it at www.godaddy.com  One of the things she wanted to add to her site was a list of videos that would only be available to people with a valid username and password. About 5 years ago I wrote a password protection program for her in Java, but when she tried to use it, it didn't work. I looked for the source code, but it must've been on a latop that no longer works; it ran Windows 98 and I wrote in J++.  I could've writen a new password protection program, but I didn't want to use Java! I decided a scripted language would be better because I could show my wife how modify it if she needed too.

     I wrote a username/password page in html, using form values that got passed to a perl script. The perl script reads the possible username/password combinations from a text file, and redirects to the private page if there is a match between what's entered into the form and what's in the text file. The private page checks to see if the referrer is the perl script, and if it isn't the user is redirected back to my wife's home page. Pretty simple, and my wife can edit the scripts and the text file as she sees fit.

     Of course, you don't want anybody to be able to view the contents of the password text file, so I added an .htacces file to the folder containing the password text file, denying from all.

<Files file-name>
Order allow,deny
Deny from all
</Files>

Unfortunately, this had no effect at all. I called up Godaddy technical support, and the rep told me I needed to read a tutorial on how to write .htaccess files, adding that they were very difficult to use. The .htaccess file I wrote was identical to the one in the Apache httpd.conf file for hiding .htaccess files from view (except for a different file name); it had to be correct.

     I tried a bunch of different .htaccess schemes, but none of them worked. Finally I tried searching the Internet for people who had similar problems with Godaddy.  After looking at several pages I finally found one where the poster said he found the problem was he had Java set as one of his host languages, and that stopped the .htaccess file from working. I also had Java set as an active language, so I de-activated it and now my .htaccess file works!

 

Having Java activated on your Godaddy site will stop your .htaccess files from working!

 

Back To My Blog Page