Code to solve most canonical issues

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/
RewriteRule index\.html$ http://www.example.com/%1 [R=301,L]
</IfModule>

 

-this code needs to go in the .htaccess file located in the root location of your domain name
-apache code only
-
be sure to replace example.com with your own domain name
-if your homepage is something different than index.html...
-(such as index.php) then replace the index.html part with index.php instead
-then cut-and-paste into your .htaccess file
-always test before using on live site

This code will redirect your domain to the www one.

e.g http://freespace.com.au >> http://www.freespace.com.au

and

http://www.freespace.com.au/index.php >> http://www.freespace.com.au


 

  Latest articles

The Three Principles of HTML Code Optimisation

Ze Network © 2006 Free Space Australia Inc. All rights reserved. Pagerank

Mobile Games   Wallpaper World   Tran Community