Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

need help creating .htaccess file for linux web hosting

Posted on 2006-11-07
5
Medium Priority
?
160 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 1000 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
Fine Tune your automatic Updates for Ubuntu / Debian
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

885 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