Our site www.viart.com site is operated by latest Viart Shop 5 with default Clear design
Printer Friendly Tell a Friend

Search Engine Friendly Redirects

When it comes to on-line websites and Search Engine Optimisation, we all have to go through the stage of addressing issues related to Duplicate Content, Loosing Google Page Ranks and Search Engine Crawl errors. This kind of issues can arise on any website when you change file names, content or delete files.

Using 301 redirects is the best way to address the above mentioned issues.
A 301 redirect tells the search engine that a page has been permanently moved. By specifying this, the page rank/popularity of the old page will be moved to the new one.

The following demonstrates few examples of creating these 301 redirects via the .htaccess file on Apache server 

301 Redirect the entire old site to a new domain

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]


301 Redirect old path to new

 RewriteRule ^old_file.htm(.*)$ http://www.sitename.co.uk/new_file.html [R=301,L]

According to the way the root file on servers is configured, by default http://www.sitename.com/ and http://www.sitename.com/index.html (.htm / .php / .asp) exist. This is the same page with two different paths to it and Google considers this as duplicate content. And in such cases it usually splits the page rank between the two. So, the following 301 redirect eliminates this issue..

301 Redirect /index.html to /

 RewriteEngine On
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{THE_REQUEST} index\.html
RewriteRule .* http://www.sitename.com/ [L,R=301]

Same is the case with non-WWW version of the site. Again, dependent on server configuration, both these links can exist - http://www.sitename.com/ and http://sitename.com/ which again leads to the duplicate content issue. 

301 Redirect non www to www

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^sitename\.com [NC]
RewriteRule ^(.*) http://www.sitename.com/$1 [R=301,L]

This gets better, we recently had a client who had different set up for HTTP and we had to create the above redirect only for HTTP and not HTTPS..the following shows you how to do this..

301 Redirect only non WWW to WWW only for HTTP

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{HTTP_HOST} ^sitename\.com [NC]
RewriteRule ^(.*) http://www.sitename.com/$1 [R=301,L]

 (replace the port number with 443 to create redirects for HTTPS)

The following is a useful extension where all the files on your server are .php and you need a .html extension...

301 Redirect from .php extension to .html

RewriteEngine on
RewriteBase /
RedirectMatch 301 (.*)\.php$ http://www.example.com$1.html

There are many instances where we wish to point more than one domain to our website. In such case, we usually point the A records of the second domain to the website and then create a HTAccess file with the following rule: 

301 Redirect new domain to primary

Rewritecond %{HTTP_HOST} domain_name2.co.uk
RewriteRule ^.*$ http://www.domain_name1.com%{REQUEST_URI} [R=301,L]

IMPORTANT NOTE: Please take a backup of your current HTAccess file if present and test the website immediately to see if the new rules added work.


Latest News   Latest
On Sunday 11th of November 2012 our servers will be updating hosting software including PHP version. It means starting from around 11:00 a.m. (GMT+0:00) you may experience some interruptions in service for a couple of hours.  read more...read more...