.htaccess File Overview
In the previous chapter we have learnt about the basic idea of .htaccess file. In this tutorial we will be talking about the .htaccess file so that you can understand the basic logic behind the use of .htaccess file.
Why to use .htaccess File ?
Consider you are owner of the WordPress website which is capable of making decently money for you. Then you must prevent your website from different 3rd party systems which makes your site prone to different attacks. Below are some of the things, the web developer must consider in order to secure your website -
Things to remember :
If you moved your website from the older address to newer address then how to tell all the visitors and search engines about you new address ?
If your images are used on the third party website then whenever any person visit 3rd party website, images will be loaded from your server. It simply means that request will be made to your server but page will be loaded for 3rd party website. You are unnecessarily allowing 3rd party users to consume your resources.
Search engines visit your website using the crawlers to explore new content, similarly there are some bad boats which may crawling your website to collect email addresses or other information. In this case you may need to make proper setting to server which will allow access to only trusted boats.
In some cases if you have page at below address -
http://www.abc.com/dir/main.html
User may explore all the files stored into the directory using the below URL -
http://www.abc.com/dir/
Answer to all the questions is to use .htaccess file which solve many problems just by doing some small configurations.
Example of htaccess file : Redirect your home-page/+ URL to your Google+