How to redirect a web page, the smart way
September 9th, 2008
Article: How to redirect a web page, the smart way
Author: Steven Hargrove
Posted: April 2006 | Steven Hargrove’s Blog
Full article: http://www.stevenhargrove.com/redirect-web-pages/
Summary: Steven not only outlines the importance of having a redirect file but lays out easy to follow steps of how to implement redirect files for all types of code including HTML, IIS, ColdFusion, ASP, PHP, ASP .Net, JSP/JAVA, etc. Steven also explains the value of using a 301 Redirect Using Mod_Rewrite for SEO purposes. Without the 301 Redirect Mod_Rewrite, Google may evalute www.yoursite.com and yoursite.com as two separate entities with two separate page ranks. Hence, the importance of a 301 Redirect Mod_Rewrite.
Breakdown:
- Create a file on the root directory of your website, name it “.htaccess”.
- Open the .htaccess file using notepad or what ever text editor that you prefer.
- Add this into the .htaccess file, save it and then upload it to your web server:
RewriteEngine On
rewritecond %{http_host} ^yoursite.com
rewriteRule ^(.*) http://www.yoursite.com/$1 [R=301,L]
rewritecond %{http_host} ^yoursite.com
rewriteRule ^(.*) http://www.yoursite.com/$1 [R=301,L]










