Introduction To HTACCESS

HTACCESS stands for Hypertext Access. It is a directory-level configuration file used on Apache web servers.

By customizing the htaccess file, you can get the most out of your website’s functionality and can improve your search engine rankings through search engine optimization (SEO).


There are two common ways to access your .htaccess file :

1. File Manager : Login to your hosting account to access and modify your files. You can do this by using your web based File Manager.

2. FTP (File Transfer Protocol) : You can access through an FTP client software. I prefer Filezilla.

Browse to the root of your publicly viewable folder. This is mostly named as public_html or www. In this folder only your homepage located.

If you are already familiar with .htaccess, you can try these :

1. How To Create 301 URL Redirection?

How to Create A HTACESS file :

In some cases you won’t have an .htaccess file in that folder. You don’t need to worry for it. Creating a .htaccess is far simple.

1. Open Notepad or any other editor

2. Type the required code

3. Save it with an extension .htaccess

Note :

  • There should be no text before the period. It has to be exactly “.htaccess”.
  • It can also be saved without anything in it. HTACCESS file can also be a blank file.

Correct Permissions :

It is very important that your .htaccess file have the correct permissions for preventing others from modifying the file and take full control of your website/blog.

The permissions should be set at 644, rw-r-r. You can check the permissions by right clicking on the file and choosing permissions or CHMOD with the help of FTP Client Software.

Now you have created your .htaccess file. Watch out some worthy tutorials in upcoming posts to make your blog/website secure !

Published by

Pradeep Kumar

CEO and Founder of Slashsquare, Indian Blog Network and Web Consulting Media. HBB is a part of Slashsquare Network. I'm a Tech Blogger, Striving Entrepreneur, Atheist, and Proud Indian. Catch me on Facebook and Twitter.

20 thoughts on “Introduction To HTACCESS”

  1. I was not knowing the use of .htaccess file.. How to learn more about this file in deep? I just know that we should not do any thing wrong in this file but why?

  2. thanks for the tip, but when i tried to edit an htaccess and saved , my site coladesed, ” error in directory list ” πŸ™ @ first time, so i never touch the htaccess | but i know its very powerful though 8)

  3. Hi Pradeep,
    Sunil again. I usually don’t take time to look at other’s blogs because of time constraint. But some how, your posting are irresistible to stop opening your useful articles to the beginners like me.
    I came from your recent article “Remove WWW From The Blog’s URL Automatically”. Thanks for choosing useful content to many bloggers.

    Can you please tell me when does a comment goes in spam folder. I got this doubt when I read your reply to Sarang Dravid comment. Do you have (webmaster) have facility to specify spamming rules to comments? Just hint to the answer would be appreciated.

    Thank you.

    1. I think you are familiar with Spam section of your emails.. it is similar to blog only… but comment spam targets search engines…

      A comment usually enters spam queue if it contains mysterious links, links with words like proxies, porn, or even maybe commonly entered spam comments etc…

      My blog is protected by Akismet, when a new comment, trackback, or pingback comes it is first tested Akismet which runs hundreds of test on the comment.. and decides whether to approve or not…

      Hope thi is helpful ! πŸ˜‰

  4. .htaccess file also helps when your script or CMS forces you to put a full read, write and execute (777) permissions on the folders. These folders can easily be manipulated by anyone, therefore, you can create a .htaccess in the directory level and create a Order Allow, Deny (or Order Deny, Allow) directives to prevent unauthorized access to your folder/sub folders.

    Great tip, Mr. Pradeep Kumar πŸ™‚

    1. Buddy. It helps in many ways indeed ! πŸ˜‰

      1. Custom Error Page
      2. Redirecting A URL
      3. SEO-Friendly URLs
      4. SSL https to http

      I will try my best to cover all these in upcoming posts ! πŸ˜€

  5. Really nice info for beginners.You can also upload a blank *.txt file via your FTP client and then rename it to .htaccess

    1. You are lucky buddy ! It didn’t go to the Spam Folder ! I wonder how ?

      Yeah ! I saw the hacks .. pretty cool.. will link it in my upcoming posts ! πŸ™‚

      Cheers ! Thanks for your first comment here ! πŸ˜‰

Leave a Reply

Your email address will not be published. Required fields are marked *