• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

need help creating .htaccess file for linux web hosting

I have a web host that allows multiple domains hosted in the same hosting account, the primary site is the root directory and then the cpanel creates subdirectories for my other sites that are then converted to regular domain names.

I would like to create a very basic .htaccess file that will protect every single site in my hosting account from hackers and spambots. I need to be careful though because if I put an .htaccess file in the root directory I could easily shut down every single domain hosted in my account!

Can anyone help me write a very basic .htaccess file for basic protection of all the websites in my hosting account?

Chad
0
DisneySubs
Asked:
DisneySubs
  • 2
1 Solution
 
kblack05Commented:
I found this guide pretty valuable:

http://www.javascriptkit.com/howto/htaccess.shtml

Can you be more specific about what you wish to accomplish? You said "Hackers and spambots", I think perhaps you might have Apache server configuration confused with the overall configuration of the server computer. Typically in managed hosting, security of the accounts is a liablity of the provider, and ultimately they are responsible for the security of the system as a whole. You can contribute to this.

If you are worried about someone abusing some web feature of one of the sites, a more direct example will help me guide you.

0
 
DisneySubsAuthor Commented:
It sounds like your saying, above, that I don't need to worry about that much about security because my web host is in charge of that. Is that right? But there are a few things I can do to fortify my security. For example, I know it's possible to use .htaccess to prevent spambots from crawling my site, at least the one's that are named. Although I don't know the specifics on how to do this. Is there anything that I use .htaccess for to make my site more secure? I have a somewhat controversial site and some people would love to hack me...

Also, it's important to me that my .htaccess file doesn't restrict people from viewing my subdomains.

Thanks!
Chad

0
 
kblack05Commented:
Yes thats correct. Bad bots often ignore the contents of your robots txt file, so you are wise to use .htaccess to block the spiders and bots. Note that mod_rewrite is a much more complete method, but requires much more administrative overhead to set it up. In other words, you would probably need to have help from the sysadmin to effect the mod_rewrite rules to Apache....so. That being said...

Use the clockwatcher's tool to create your .htaccess file for killing bots and spiders here ->

http://www.clockwatchers.com/robots_bad.html

Here are some tutorials on how to accomplish what you are looking for...

http://www.robotstxt.org/wc/exclusion.html
http://www.fleiner.com/bots/
0

Featured Post

SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now