Need help? Call us on 1300 789 260

Simple web site redirection via .htaccess

Difficulty: Intermediate


During the life of a web site it may undergo a name change and rather than have visitors hit the old web site you may wish to have them automatically redirected to a new web address. To achieve this, web servers allow administrators (and web site owners with access to the file system) to implement re-directs using a special file.

The Apache Web Server uses a file called a ".htaccess" file, this file enables fine grained control at a directory or sub-directory level. To implement a redirect from an old site to a new site, you can create a .htaccess file using a text editor on your computer and upload it to the web site. The change will take effect immediately.


The following lines need to be entered into the .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) [R=301,L]

Ensure that the name is .htaccess the "." is significant!

FTP it into your web site document root and test. If it fails without an error contact your web site administrator to verify that the web server config allows .htaccess files (normally enabled by default).

Was this article helpful? Yes No

Having trouble? We’re here to help!

We’ve built our company with a serious focus on quality service. Feel free to give us a call!

1300 789 260