SEO & ASP.NET: How content is linked really does matter

See the first post in this series

Tip #2 - How people link to you really does matter

Have you ever taken the time to look at all the different ways you link to your content? For ASP.NET developers there are typically 3 ways to link to the default page (usually default.aspx). For example, let's say there is a landing page in your site for "Products" under the directory /products with a default.aspx page. Therefor you could link to it as:

  • example.com/products
  • example.com/products/
  • example.com/products/default.aspx

Which is the right one to use? This largely depends on what you are doing. My personal preference would be to load up the URL with keywords (more on that in a future post) and to not show the page with the extension.

In my opinion the right choice is:

  • example.com/products/

Why does this matter?

In Google's eyes example.com/products and example.com/products/ (note the trailing slash) are 2 different pages! In fact, example.com/products/default.aspx is considered to be a different page as well!

So let's say you've written a brilliant piece of content and people are linking to it like mad (good for SEO). You're on Digg, cnn.com, and even Mr. Guthrie covered you! Let's say there are 1,000 total links to your post - you are golden right? Well, maybe not.

If 25% of the people linked to example.com/products, 50% linked to example.com/products/, and the remaining 25% linked to example.com/products/default.aspx you would not be maximizing your incoming links. Instead you would be supporting 3 different pages of the exact same content. The number of external incoming links is very important for SEO and if you don't control how people are linking to your content you are reducing your ability to get higher in natural search results.

This can get even worse if you are serving content for 2 domains as discussed here.

How to solve this?

The good news is that solving this is fairly straight forward using HTTP 301 status codes.

A HTTP 301 status code tells the browser to redirect to another URL and that the redirect is permanent. Another status code, 302, is used by ASP.NET developers all the time (using Response.Redirect which we'll cover in a future article) also redirects to another URL but says that the redirect is temporary.

The difference between a 301 and 302 is not noticeable by people browsing a site, but for search engines its meaning is very important: a search crawler will follow a 301 but will not follow a 302.

The recommendation would be for ASP.NET developers to use something like an HttpModule to examine all incoming requests and examine the path of what is being requested. If a request is for /default.aspx or for a page that doesn't have a file extension the HttpModule could short-cut the request and send an HTTP 301 back to the browser redirecting to the right URL:

Response.RedirectLocation = "/products/";
Response.End();

Yes, this also does mean that for every incorrect URL requested you're going to ask the browser to fetch a new URL (2 requests to the server). But the good news is that when search crawlers find the links - no matter the format - they will be given the right link through the 301 redirect and ensuring that you aren't showing different pages for the same content.

What about preventing search engines from accessing certain parts of your site? You can use a robots.txt file as well as a META tag with a noindex option on individual pages. Just be careful about what you include in robots.txt - one of the first places a hacker can look to see what you are trying to hide is your robots.txt file.

Next Tip: Put keywords in the URL

Published Wednesday, April 23, 2008 9:55 AM by Rob Howard

Comments

# re: SEO & ASP.NET: How content is linked really does matter

Wednesday, April 23, 2008 1:47 PM by Guy Harwood

Rob,

This is something we have been questioning recently as results returned from yahoo show no www, however all other search engines include the www.  No links can be found pointing to the 'www-less' version.  Still, its a concern regardless.

Ive been testing how to manage this in asp.net and it appears that IIS is 'decorating' each request with 'default.aspx' even if i request mysite.com/products

none of the available request information shows the URL as i entered it on my browser (without the default.aspx)

How do you determine this? as i can't engineer a workaround if i cant detect it in the first place.

# re: SEO & ASP.NET: How content is linked really does matter

Wednesday, April 23, 2008 3:51 PM by James

What's the best way to handle content that is only made available through a user search. For example, my home page has a few dropdownlists, a text field and a "Search" button. In code behind I'll catch the button click event and then Response.Redirect (appending selections to the querystring) to the Search Results page, listing all matching items. Will Google et al not be able to find this content?

# re: SEO & ASP.NET: How content is linked really does matter

Wednesday, April 23, 2008 6:16 PM by Richard Burckhardt

Good stuff. I recently blogged on the same thing, but in a slightly less technical way (URL included - click on my name).

Your post is really good for the ASP team that I work with who, well, needs it spelled out in code. Sometimes I think that they think an SEO couldn't possibly know this stuff!

;-)

Thanks!

# re: SEO & ASP.NET: How content is linked really does matter

Thursday, April 24, 2008 7:04 AM by Rana

I am using the same tactics, never know that Search Engine will take three different way.

Obviously page ranking matters with this.

Good job.

Thanks,

# re: SEO & ASP.NET: How content is linked really does matter

Thursday, April 24, 2008 6:36 PM by Wayne

This problem is the same thorn in our sides as the browser wars were...You would think search engines would be able to accomodate this.