Kanga Articles

Welcome Guest

Search:

3 Reasons Why You Need a Htaccess File

View PDF | Print View
by: Guest
Total views: 335
Word Count: 449

Most of us don\'t know it but it\'s there most of the time. Sitting, waiting, doing it\'s job quietly.





Most of us don't know it but it's there most of the time. Sitting, waiting, doing it's job quietly. I'm talking about the humble .htaccess file that sits in the root of a web server, usually. A .htaccess file has many functions and in this article, I am going to talk about how you can use it for the purpose of beautifying your site's URL and making it readable for both humans and search engines.

.htaccess For Newbies

.htaccess are invisible plain text file where you can store server directives. These .htaccess files only affect the folder that they reside in and the folders inside it. This means that each sub-folder inherits the .htaccess properties from its parent. The easiest way to create a .htaccess (if it is not present in your server) is to use an FTP client, create a new file and naming it.htaccess. A point to note is making sure that your FTP client can display hidden (or invisible) files.

The 3 Reasons

  1. More Beautiful Permalinks If you use WordPress, you are probably familiar with the term pretty permalinks. By default, all the URL for your pages or posts looks like yourdomain.com/?p=123. Not only is this ugly, it doesn't make sense to both humans and search engines. A simple solution is to change your permalinks in the WordPress settings and this requires a.htaccess be created automatically or manually.
  2. WWW Or No WWW Read the WWW Or No WWW In Your URL article that was written by me. It doesn't really matter to the human visitors but it does for the search engines. Without defining which version of your URL to use, the search engines regards the two as separate sites. In the long run, it may have an impact on your site's PageRank. Read my article mentioned above on how you can fix this.
  3. 301 Redirect What if you previously had pages on your site that has been indexed by the search engines and now they are no longer there? When a visitor follows that link, they will be shown an error on your site. This does not look good for your site and you. What you can do it to do a 301 redirect in .htaccess file so that the old URL will point to a new URL.

This article wasn't meant as a comprehensive list of why you need a .htaccess file. It is meant as a starting point for those who are new to website building and need to get some things right. Have a suggestion? Let me know by commenting below.

About the Author


Rating: Not yet rated

Comments

No comments posted.

Add Comment

You do not have permission to comment. If you log in, you may be able to comment.