Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Shared Hosting Support

Notices

Reply
 
Thread Tools
  #1  
Old 03-19-2009, 09:41 PM
gwyneth's Avatar
gwyneth gwyneth is offline
Supreme Croc
 
Join Date: Sep 2006
Location: up north
Posts: 6,843
Default .htaccess resources: help, examples, tools

This thread replaces and updates the previous htaccess resources list (which is on the List of resource list threads, along with other kinds of useful stuff. I'm about to append that list with a note about the update.)

As the Apache* documentation beautifully explains, .htaccess files provide a way to make configuration changes on a per-directory basis.

Siteholders can use an .htacess file to control how the server behaves when it serves up pages in a directory and all subdirectories within (until and unless it encounters another .htaccess file). This is especially handy for people whose sites are on a shared/reseller server, because it's an alternative to the server-wide configurations they can't affect. It's also useful for dedi owners who want to pinpoint behavior, without affecting the whole server.

The links on this list provide assorted explanations, examples, code-to-copy, and include a great online .htaccess generator. I'm putting that link first, though to make the most of it you may need to read the info you get through the other links:

htaccess Generator (comprehensive)

I think the next link is the most comprehensive, easy to follow reference, but newbies may find the stuff in the next section more illuminating.

Stupid htaccess Tricks (long list, cataloged by how to)

Next, in order roughly of how basic and comprehensive they are, are what I consider the most useful sources of info:

Wise-Women: Tutorial: Using the . htaccess File

Beginners Guide to . htaccess File with Examples (good explanation)

Clockwatchers - . htaccess Tutorial - Introduction (excellent, basic walkthough and diagnosis)

. htaccess Tools (interactive, faqs)

Comprehensive guide to . htaccess - intro

Ultimate htaccess Examples | evolt.org

the jackol’s den » htaccess Cheatsheet - Mikhail Esteves

These three are from the Apache folks themselves--your cPanel will show you which version of Apache your server is running.

Apache 1.3 Tutorial: . htaccess files

Apache 2.0 Tutorial: .htaccess files - Apache HTTP Server

Apache 2.2 Tutorial: .htaccess files - Apache HTTP Server

Here are a few sites that discuss how .htaccess files can boost your site's security:

A Close to perfect . htaccess ban list (c. 2001)

A Close to perfect .htaccess ban list - Part 2

Comprehensive guide to . htaccess - Blocking bad bots and site ...

Proper syntax for banning bad bots in htaccess

Security4all: Blocking Bots with .htaccess Ban List

Preventing Image Bandwidth Theft With . htaccess (thesitewizard.com)

Watch out for Wordpress .htaccess hack

Here are other relevant links from my bookmark list:

Vortexmind: free your mind » Apache . htaccess tweaking tutorial

Fun with . htaccess

5 htaccess Tricks Every Webmaster Should Know

.htaccess File and mod_rewrite examples

mod_rewrite Tips and Tricks for Apache .htaccess

*As you probably knew or figured out from context, Apache is the name of the software that runs most servers. If you don't have a Windows server here at HG--AND YOU PROBABLY DON'T, your Linux server runs Apache, and vice versa.)
Reply With Quote
  #2  
Old 03-20-2009, 01:02 AM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,164
Default Re: .htaccess resources: help, examples, tools

Wow, this is huge-- thanks Gwyneth. It'll be great to be able to point people here.
__________________
Follow me on Twitter! http://twitter.com/mrw
Reply With Quote
  #3  
Old 03-20-2009, 01:11 AM
striddy's Avatar
striddy striddy is offline
Veteran Croc
 
Join Date: Mar 2008
Location: /home/australia/earth
Posts: 4,093
Default Re: .htaccess resources: help, examples, tools

Quote:
Originally Posted by gwyneth View Post
This thread replaces and updates the previous htaccess resources list (which is on the List of resource list threads, along with other kinds of useful stuff.
Gwyneth does it again with another fantastic resource list.
__________________
- David
Reply With Quote
  #4  
Old 03-20-2009, 01:26 AM
virtvir5's Avatar
virtvir5 virtvir5 is offline
King Croc
 
Join Date: Feb 2009
Location: Parry Sound, Canada
Posts: 1,245
Default Re: .htaccess resources: help, examples, tools

You might want to update those "close to perfect" ban lists. They're several years behind enemy advances. In fact, keeping up with "bad bots" and their offshoots is a neverending process. Any static listing that isn't updated regulary rapidly falls victim to obsolesence.
__________________
Regards, Richard
VIRtech.org
Reply With Quote
  #5  
Old 03-20-2009, 03:27 AM
gwyneth's Avatar
gwyneth gwyneth is offline
Supreme Croc
 
Join Date: Sep 2006
Location: up north
Posts: 6,843
Default Re: .htaccess resources: help, examples, tools

Thanks, Matt and David! I went through the old list and rearranged it, checked all the links, pruned some and added some.

Quote:
Originally Posted by virtvir5 View Post
You might want to update those "close to perfect" ban lists. They're several years behind enemy advances. In fact, keeping up with "bad bots" and their offshoots is a neverending process. Any static listing that isn't updated regulary rapidly falls victim to obsolesence.
Yes, of course...but a) they're not not my ban lists and b) the idea is to show people what's possible.

Somewhere I've got a link for a site that has a list of about 15,000 user agents, but it may be on another computer and several search queries just now failed to get Google to spill it up.

IMO, that shows that people should think and do some research before implementing any ban list that goes beyond their own known bad visitors.

Here is some other pertinent info. The first link is to the "Stupid .htacess tricks" site mentioned above.

Ultimate htaccess Blacklist 2 (Compressed Version) • Perishable Press

Treasure Coast Designs » Denying IP Ranges with htaccess

10 awesome . htaccess hacks for WordPress

ZB Block, Protect Your PHP Driven Site from Spam and Hacks ...

16 Useful . htaccess Tricks and Hacks For Web Developers

How to stop image hotlinking and bandwidth theft | David Airey ...

Last edited by gwyneth; 03-20-2009 at 03:29 AM.
Reply With Quote
  #6  
Old 03-20-2009, 12:08 PM
virtvir5's Avatar
virtvir5 virtvir5 is offline
King Croc
 
Join Date: Feb 2009
Location: Parry Sound, Canada
Posts: 1,245
Default Re: .htaccess resources: help, examples, tools

Quote:
Originally Posted by gwyneth View Post
IMO, that shows that people should think and do some research before implementing any ban list that goes beyond their own known bad visitors.
I agree. That's why I posted this item which links to a UA list that is regularly updated based on currently ongoing research dedicated to precisely that purpose.

I understand your point that none of the links and lists are your own, but that's not an issue as far as I'm concerned. Anyone is welcome to grab "mine" (actually Michael Hampton's converted for .htaccess) and do anything they want with it. In fact, that was my primary intention.
__________________
Regards, Richard
VIRtech.org
Reply With Quote
  #7  
Old 03-20-2009, 12:14 PM
GatorJacob's Avatar
GatorJacob GatorJacob is offline
HostGator Staff
 
Join Date: Apr 2008
Location: Houston
Posts: 7,294
Default Re: .htaccess resources: help, examples, tools

Sticked

Nice information Gwyneth!
__________________
Jacob P
HostGator.com
Systems Monitoring Supervisor

Reply With Quote
  #8  
Old 07-12-2009, 05:25 PM
gwyneth's Avatar
gwyneth gwyneth is offline
Supreme Croc
 
Join Date: Sep 2006
Location: up north
Posts: 6,843
Default Re: .htaccess resources: help, examples, tools

For people who are having trouble seeing (finding) .htacess files, Rick has some help here.
Reply With Quote
  #9  
Old 07-21-2009, 07:42 PM
avalanch avalanch is offline
Swamp Croc
 
Join Date: Jul 2009
Posts: 257
Default Re: .htaccess resources: help, examples, tools

Here is another great person and a great deal of .htaccess can be learned by this thread here.
http://forums.digitalpoint.com/showthread.php?t=23044
Reply With Quote
  #10  
Old 07-25-2009, 04:50 PM
Doru Doru is offline
Hatchling Croc
 
Join Date: Jul 2009
Posts: 3
Default Re: .htaccess resources: help, examples, tools

Nice tutorial! Thanks you gwyneth.
Reply With Quote
  #11  
Old 03-20-2010, 08:23 PM
gwyneth's Avatar
gwyneth gwyneth is offline
Supreme Croc
 
Join Date: Sep 2006
Location: up north
Posts: 6,843
Default Re: .htaccess resources: help, examples, tools

Towards the end of this thread, kompreszor has provided an excellent example of what to put in an .htacess file to keep bad bots from affecting a forum:

How can I limit baidu spider? - HostGator Peer Support Forums
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
htaccess resources gwyneth Shared Hosting Support 6 03-20-2009 03:00 AM
Provide examples of CronJob windyhair Suggestions 1 01-29-2008 02:44 PM
Examples of sites running WHMautopilot / question about my own zzz WHM Autopilot 12 02-25-2007 06:02 AM
Live Examples abstraktMedia Pre-Sales Questions 2 09-01-2003 07:49 AM

All times are GMT -5. The time now is 06:51 AM.