Editing Your .htaccess File

Index Box

An .htaccess file can help you make important changes to your website. Last time, we looked at creating and editing your file – now, what can you put into it? Let’s take a look at some of the options available to you.

  • 404 errors. Generic 404 pages might not alienate visitors – but they might. They also don’t do anything for you. Several sites have had great luck creating funny, entertaining, and informative 404 pages. Our suggestion is that you be one of them! Design an attention-getting 404 message and page, and then edit your .htaccess file to ensure it is displayed to visitors.
  • Authorization. You can have control over who sees your site. You can either block certain IP addresses or domains (to avoid things like spambots) or add a password option.
  • Enable keepalive. This command keeps the connection open between a server and browser for a specified period of time. This way, the browser does not have to make multiple, separate requests for content, and the page can load faster.
  • Redirects. If you’ve moved, you can keep visitors and search engines up to date as to your whereabouts without impact your search rankings.
  • Allow SSI, or server side includes. SSIs are directives in HTML pages that let you add content to an existing page. Say you include a daily quote on your website. With SSI, you can add a directive to include the quote without having to get into the programming of your site.

There are a number of tutorials and online resources dedicated to helping you navigate your .htaccess files. This is just a rundown because books can – and have – been written! As always, make a copy of your .htaccess file before making any changes!

Leave a Comment