Forum Moderators: phranque

Message Too Old, No Replies

Be careful with that .htaccess file

         

guitaristinus

10:30 am on Nov 9, 2004 (gmt 0)

10+ Year Member



Yesterday I added some "Deny from" IP addresses to my .htaccess file and thought I would keep it organized by putting ranges of addresses on different lines. I was sure to put a space before the line breaks. I didn't bother starting each line with "Deny from". I assumed it would be read as one long line. Any way, the site gave out an internal server error (code 500) for about 10 hours before I happened to go to the site and find out about it.

Morals of the story:
1) the .htaccess file is powerful
2) after any changes to it, it's best to go to the site and make sure it's OK

coopster

1:01 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Absolutely. Test, test, test ;)

buckworks

1:36 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Any kind of typo whatsoever in the .htaccess file can bring down your site.

Don't ask me how I know that ... ;-)

jdMorgan

4:45 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I suspect that the reason it's called a "500 Server Error" is that it takes at least 500 errors that lock up the server before anyone can claim true proficiency with mod_rewrite and mod_access... ;)

"Experience is what enables you to recognize a mistake when you make it again." -- Unknown

Jim

nancyb

5:16 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



and -- just because you don't get a 500, don't assume your new additions work.

I just spent the last two weeks trying to figure out why bots were getting thought that never did before :(

Never did discover what I did, but after extensive testing I finally just retyped each line. Finally, it works correctly. All I can figure is that I copy/pasted something that must have included some nonprinting characters (even though I had that setting on so I could see).

Whatever the mistake, it ended up costing because I exceeded my bandwidth.

Matt Probert

6:04 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




Morals of the story:
1) the .htaccess file is powerful

Apache's .htaccess files are Apache server configuartion files that override the primary configuration files. If possible, use the primary configuration file, but in any event:

1) Make a backup copy
2) Read the documentation
3) Read the documentation
4) Read the documentation
5) Test it
6) Test it
7) Test it

I think you get the idea <g>

Matt