Navigation

MAIN
Home
Articles
Report Your Scams
Dictionary

My Affiliate Place Blog

Sitemap
Contact
Privacy Policy

 Subscribe in a reader


TECH SECTION
COMPUTERS &
ELECTRONICS

Dell Weekly Deals
Dell Server-Electronic Deals
Dell Deals-Consumer


TECH INFORMATION
Buying A Laptop
Buying A Desktop
Protect Your Data
Tech Corner



LEARN AFFILIATE
MARKETING

Affiliate Marketing Info
Landing Page Basics
Net Etiquette


AFFILIATE PROGRAMS & PROMOTE
Find Affiliate Programs
Promote Your Business


ADSENSE
Adsense TidBits
Adsense Basics


ADWORDS
Adwords Basics


SEO
SEO Basics
Meta Tag Tips
Search Methods


WEBSITE BASICS
Website Types
Build|Design Websites 
Domain|Subdomain Facts


WEBSITE PROTECTION
htaccess
Robots.txt





Protecting Your 
Website with a htaccess file






Protect Your Website with a htaccess file?


The htaccess file is just one way of protecting your website. If you've just put your website online, and you are new to the Internet Marketing arena, you may not realize how vulnerable you are to attack. Or, you know, and just don't know what to do, how to do it, or expect it to be to difficult to do.

First, let's get the "it's too difficult" idea out of the way. It's not difficult to set up an htaccess file.
I'll try to explain how to set up an htaccess file and how to bring it online to your server. So let's begin.


What is a htaccess file

The  htaccess file (hypertext access) allows you to customize your configuration to specify security restrictions for your directory or directories, password protect areas on your site, deny or allow IP addresses, and deny or allow search engines, and customize your error responses (such as 404 errors or rewriting your urls). And it is important. 

Though the robots.txt file is your first line of defense, some robots, will try to ignore your instructions and take what they can without your permission. This is where the htaccess file takes center stage, its your second line of defense against unruly bots.


How do you create an .htaccess file?

The htaccess file is created as a text file (htaccess.txt). After creating the file, you would FTP the file to your server, than rename the htaccess.txt to .htaccess. Please note you need the (.)period before the name and no ".txt" at the end, when you rename the file on your server.

To create an htaccess file you will only need notepad. Next, you will determine what elements you want to place in your file. Below you will find different commands that will help you with different areas of concern for your website.


Custom error pages and htaccess

Error pages and htaccess work hand in hand. If you create a custom error page you will place instructions within your htaccess file on how visitors and robots can interact with the page.

Creating error pages is not difficult if you know the type of error you are wanting to use. For example: Custom 404 error message is "no page found" error. This error page can pop up when the following events happen:

  • Broken link
  • Page has been deleted
  • Mistyped url
  • Server Offline

Should you have a 404 error page? Yes. It can possibly give your traffic another opportunity to visit your site, rather than just clicking away.
And if you custom design a 404 error page you'll leave your visitors with a nice experience instead of a plain "404 error" without knowing why, or directing them to look elsewhere.


Does Your Server Allow Custom Error Pages?


The next question you have to ask is: Does my server allow custom error pages? If you are unsure, then I would contact your web hosting service to ask if they allow custom error pages, and if they do, how you need to proceed. Why do I say this?

Web hosting has come a long way. And they are trying, I would guess to not make, not only your job easier, but their job easier, as well. With that being said, some web hosting services allow you to update your custom pages through a GUI interface (You just need to plug in the information they request and where your custom error page is sitting).

And yet others, will direct you to a GUI interface where you can create an htaccess page.  (Rule of thumb, ask before proceeding and inadvertently blowing up your website.)

If they direct you to the use of an htaccess file, then this is the code you would put in the file after you have created your 404 error page. 

ErrorDocument 404 /nofile.html
(ErrorDocument errornumber /file.html



The nofile.html would be your custom file for no file found. You would then upload the nofile.html onto your service along with your .htaccess file.


Denying access with your htaccess file

If you have a bot that will not follow the rules, or is taking valuable bandwidth from you, you can deny that bot access through your htaccess file. Below is the code that you need to use to deny access of "CherryPicker"

#block bad bots
SetEnvIfNoCase User-Agent "^CherryPicker" bad_bot



<Limit GET POST>
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</Limit>


(The ^ code in front of CherryPicker indicates the command of "anything that begins with")

The code <Limit GET POST> goes at the bottom, it gives instructions to deny access to all that you put in your list.

The "#" is just a symbol for a comment




Configuring your htaccess file and redirects

The best way to create a redirect is through the htaccess file. If you are contemplating using a META redirect (that occurs within the <HEAD> of your web page) please reconsider. Why?

Many search engines have troubles with this one and spammers use it in bad ways. Since the robots do not know a good guy, from a bad guy, you may find yourself inadvertently banned by the search engines.  With that being said, this is how you can do a redirect.

Redirect of a single page:

Redirect 301 /oldpage.html
http://www.example.com/newpage.html


Redirect of a whole site:

Redirect 301 /http://www.example.com/

The htaccess file, along with the robots.txt give search engines and bots direction, as well as, a means of protecting your bandwidth and data from unruly bots.


Relevant Articles


Spamming, Your Stats, Website, Blog and Social Media














Copyright © 2005-2012 All Rights Reserved My Affiliate Place | Website Protection-htacess