Solved

need help creating .htaccess file for linux web hosting

Posted on 2006-11-07
5
149 Views
Last Modified: 2010-04-22
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
Comment
Question by:DisneySubs
  • 2
5 Comments
 
LVL 11

Expert Comment

by:kblack05
ID: 17908349
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
 

Author Comment

by:DisneySubs
ID: 17911869
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
 
LVL 11

Accepted Solution

by:
kblack05 earned 250 total points
ID: 17914698
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now