.htaccess Tricks

The most common question i get is “How do i redirect my site?”. The answer is simple : “.htacess rules”.

There are several reasons why a redirect should be done , the most important being change of URL. When you rename a file or move it to another folder the link is lost because search engines might have already crawled your site and are still pointing to the old file-name or location.  This would lead to a nasty 404 error, unless ofcouse we add a .htaccess redirect.

Here’s how it’s done. create a new file with the name “.htaccess” and add the following:

Redirect 301 /OLD-FILENAME.html http://www.MYDOMAIN.COM/NEW-FILENAME.html