Navigation

MAIN
Home
Articles
Ebooks
Report Your Scams
Dictionary

My Affiliate Place Blog

Sitemap
Contact
Privacy Policy

 Subscribe in a reader


TECH SECTION
BUSINESS SOFTWARE
Accounting Software
Video Web Conferencing


COMPUTER SOFTWARE
Norton Utilities Software
Norton Business Security 


COMPUTERS &
ELECTRONICS

Dell Weekly Deals
Dell Server-Electronic Deals


TECH ACCESSORIES
Tech Accessories Deals


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
Keyword Research
Search Methods


WEBSITE BASICS
Website Overview

Web Host Services Compare
Building Your Website 
Domain and Subdomain
Website Protection-Robots.txt


EQUIPMENT FOR
ONLINE BUSINESS

Buying A Laptop
Buying A Desktop
Protect Your Data


ARTICLE MARKETING
Article Marketing
Article Submission Services


EMAIL MARKETING
Email Marketing


BLOGGING
Blogging Basics
Blogging Income

PODCASTING
Podcasting Overview
Mechanics of Podcasting


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. Below, 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.



htaccess

In most cases you will have to create your own htaccess file, but yes, some web hosting services are beginning to offer services to help you create an htaccess file. If you're one of the few that have this service, you're in luck. But for those who need an htaccess file-it's time to explain, first, what an htaccess file is.

The  htaccess file (hypertext access) allows you to customize your configuration to specify security restriction 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. Why? Though the robots.txt file (You'll find a link that will take you to a webpage on how to create a robots.txt file below) is your first line of defense. Some robots, if they don't want to listen, will ignore your instructions in your robots.txt file and take what they can without your permissions. This is where the htaccess file takes center stage - in your next line of defense.



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. Yes, an htaccess file begins as a text file and will be renamed when you put it on your server.
You will have to put a period (.) in front of htaccess and drop the text (txt) extension at the end.

Next, you will determine what elements you want to place in your file. Below you 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


#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 use 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/




Are there any other backend tools that you should have on your server to protect your website? Yes. It's a Robots.txt file.


Next: Create Robots.txt File        




Relevant Articles

Referrer Spam-What Is It?
What is referrer spam? Can it affect your blog or website? The answer is yes. I'll tell you what it is, how it can affect you and what you can do about it.

Web Log-Analyze Your Data
Your web log can be a great source of information. You can learn a lot about your website performance and your visitors, be it human or robots/spiders. It's all useful.

Sitemaps Are They Important
Site maps, are they important? Do you really need one? These were several questions that I often asked but was hesitate to ponder to closely because of the technical aspects involved.








Copyright © 2005-2010 All Rights Reserved My Affiliate Place.