Articles & Code Snippets

301 .htaccess Redirect

How to use .htaccess 301 redirect?

How to use .htaccess 301 redirect?

To prevent getting 404 File Not Found error (traffic coming from links, bookmarks and search engines), .htaccess redirect is better than the meta refresh or redirect tag because there is no delay as the browser reads the .htaccess file first.

Go to your site's root folder (public_html or www), download the .htaccess file to your local computer and edit it with a plain-text editor. If you are using FTP Client software and you don't see any .htaccess file on your server, double check your setting and make sure you have turn on invisible / system files.

To Redirect Certain Page(s):
Redirect 301 /oldpage.html Redirect 301 /oldpage2.html
To Redirect Entire Site:
Redirect 301 /