30 July 2011

301 Redirect - non-www to www


Apache Server

301 Permanent Redirect - non-www to www (Only for Websites Hosted on Apache Server)

1. Install "Mod_Rewrite" on a server.

2. create a .htaccess file, open notepad, name and save
the file as htaccess.txt (System will not support .htaccess extension)

3. If you already have a .htaccess file on your server, download it to your desktop for editing.

4. Place this code in your htaccess.txt file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^dipseducation.com
RewriteRule (.*) http://www.dipseducation.com/$1 [R=301,L]

5. Save the htaccess.txt file.

6. Upload this file to the root folder of your server.

7. After uploading "htaccess.txt file" in your root folder rename this file as ".htaccess" on a server.

8. Test it by typing in the old address to the page you've changed. You should be immediately taken to the new location.

Window Server

301 Permanent Redirect - non-www to www (Only for Websites Hosted on Window Server)

1. Install "ISAPI_Rewrite" on a server.

2. create a httpd.ini file, open notepad, name and save
the file as httpd.ini.

3. If you already have a httpd.ini file on your server,
download it to your desktop for editing.

4. Place this code in your httpd.ini file:

RewriteEngine On
RewriteCond Host: ^dipseducation\.com
RewriteRule (.*) http\://www\.dipseducation\.com$1 [I,RP]

5. Save the httpd.ini file.

6. Upload this file to the root folder of your server.

7. Test it by typing in the old address to the page you've changed. You should be immediately taken to the new location.