How to add Mime-Types using .htaccess

In case your web hosting account is not configured to server certain mime types with the proper content type. You can change this using .htaccess file. For example if you need to configure your server to display ASX files: AddType…

Enable CGI, SSI with .htaccess

As .htaccess is a powerful tool. It gives you option to change the way the webserver serves your files. On most web hosting servers you can use SSI (Server Side Includes) in shtml, or shtm files. However, you need to…

Force SSL/https using .htaccess and mod_rewrite

Sometimes you may need to make sure that the user is browsing your site over securte connection. An easy to way to always redirect the user to secure connection (https://) can be accomplished with a .htaccess file containing the following…

Redirect URLs using .htaccess

Sometimes you need to redirect some URL and/or page on your site to another one. The feature is very useful if you have recently redesigned your site but you wish to keep the old addresses working for various reasons (you…

Using .htaccess to block referrer spam

Lately referrer spam became a great annoyance for the webmasters. If you are not sure what referrer spam is you may wish to check this article: http://en.wikipedia.org/wiki/Referrer_spam To block these spam referrers you need the following lines in your .htaccess…