engine crawlers will look for as much of information’s to know more about your
pages and the products it is offering in order to present your page in front of
the users who is searching for it. Hence, apart from offering new features
to their users it become vital for web masters to make their websites search
engine friendly. Understanding this need, Microsoft shipped some very new good
features that are really helpful to make your pages search engine friendly.
Moving forward, we will see some of the
new features offered by ASP.Net 4.0 for making your page search engine friendly.
Some of the new features
1. Add MetaKeyword and MetaDescription through Page object
2. Permanent Redirection
3. Search Engine Friendly URL’s
We will see more about these features
in this article.
Add MetaKeyword and MetaDescription
through Page object
Meta tags are
special HTML tags that are not displayed to the users but injected to
<head> tag for describing the page content. Search engines will use the
information in the Meta tags to categorize the contents and to know more about
the pages. There are 2 types of meta tags which can be injected to a page to
make the search engine understand it. They are,
1. Meta keyword
tag should include some keywords of the contents or products the page is
offering. For instance, if your page serves for an asp.net tutorial it can be
<meta name="keywords" content=".net,
asp.net, C#, Sqlserver" />
2. Meta Description
A meta keyword tag can be used to
describe the page content or products.
<meta name="description" content="The
.NET Framework is Microsoft's platform for building applications that have
visually stunning user experiences, seamless and secure communication, and the
ability to model a range of business processes. " />
Hence, this made the meta keywords and
description one of the most important components of a page when we want to make
it search engine friendly.
ASP.Net 2.0 introduced a new feature
where one can add these tags from the code behind file using HtmlMeta class. It
would have been better and easy if we are able to do this through Page directive
(Page class). This will help us to change the meta tags at any time without
re-compiling the pages. ASP.Net 4.0 added 2 new properties on the Page
directive (Page object) to let you define the Meta keywords and
<%@ Page Language="C#"
AutoEventWireup="true" MetaKeywords="asp.net,C#" MetaDescription="This is an
asp.net site that hosts asp.net tutorials" CodeFile="Default.aspx.cs"
This can also be done dynamically using
Page object from codebehind. Refer the code below,
protected void Page_Load(object sender,
Page.MetaDescription = "This is an
asp.net site that hosts asp.net tutorials.";
The above code will add the meta tags
in the output html. Refer the below output,
content="This is an asp.net site that hosts asp.net tutorials." /><meta
name="keywords" content="asp.net,C#" /></head>
We can still do this in earlier version
by defining a BasePage class. Read more here.
Permanent Redirection with HTTP 301 Moved
URL redirection is a technique used in
the internet world to let the users know that their pages are permanently moved
to different location with a status code 301. The users then will be redirected
to a correct page. Mostly, when you change your website to a different domain
the users still accessing (from bookmarks, links from other websites) the old
domain can be redirected to the new domain using this technique. Search engines
like Google will assign the page rank of the old domain to the new redirected
domain when it is redirected using this technique. If it is not done in this way
then the old domain’s page rank will be fully dropped and a new page rank will
be assigned to your new site(With new domain name). Thus, it is always strongly
recommended to make your old domain to do a permanent redirection to new domain
using this technique.
This technique is not only used for
permanent redirect of old domains but also to redirect a domain name without
“www” to with www. For example, search engines like Google will treat a page
with URL http://www.codedigest.com/Default.aspx as different from
http://codedigest.com/Default.aspx even though they are serving the same page on
a website. Thus, there are chances that Google may punish your website with
Duplicate Content violations and will remove your site from its
Duplicate Content – Since http://www.codedigest.com/Default.aspx and
http://codedigest.com/Default.aspx are treated as 2 different pages, Google will
punish you for duplicate content. Google does this for giving good search
experience to the users since presenting page with same content on Google search
result will not serve the user needs.
Improved Page Rank
Also, the page rank will be assigned to
both http://www.codedigest.com/Default.aspx and
http://codedigest.com/Default.aspx and hence making it inaccurate page rank.
Hence we need to do a permanent redirect to one URL if the user types a URL
You can either fix your site with www
or without www to make permanent redirection. One another alternate way to
prevent this issue is by setting preferred domain with Google Webmaster tool. Also,
if you have duplicate contents in your websites (separate printer friendly
pages, etc) then you can use a technique called canonicalization
which offers you some handful of solutions to prevent the duplicate content
issue easily, apart from the above.
Thus, when we move our internet page to
a different location, it is always required to send “HTTP 301 Moved Permanently”
response to the search engines to hold back the page rank by redirecting to the
new page. Understanding this need asp.net 4.0 includes a new method to do
redirection called RedirectPermanent() to do this easily.