p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 (http://p2p.wrox.com/forumdisplay.php?f=264)
-   -   TBH Search Engine Optimization (http://p2p.wrox.com/showthread.php?t=63483)

retroviz November 2nd, 2007 06:45 PM

TBH Search Engine Optimization
Hi guys.

Just thought I would get other people's thoughts/experience with this.

Before I publish my clients TBH based site I wanted to make sure that is as indexible as their existing STATIC html site.

I downloaded a copy of Zoom Search Engine (http://www.wrensoft.com/zoom/index.html) to test. As the content pages inherit the header information from the master page and the articles pages have a title of Show Article... the results are not very descriptive:


quote:14. My Company: Series D Rotary Lobe Pumps

About My Company Ltd., it's services, pumps and company
Terms matched: 1 - Score: 22 - URL: http://localhost:1124/WebSiteName/(X(1)A(qFwMD6VSyAEkAAAAZjg3MThmMTAtNTQwMC00NzA1LTg yM2UtMTkxZTYxYjc2OTRmnPkJhFaWezOWOePsMMC7KBB2x3s1) )/ShowArticle.aspx?ID=24
15. MyWebSiteName.com: Browse Articles
About My Company Ltd., it's services, pumps and company
Terms matched: 1 - Score: 19 - URL: http://localhost:1124/WebSiteName/(X(1)A(fI6mEaVSyAEkAAAAYWQ0NDYwNjEtYzQ4NS00ZjZlLTl iYjAtM2MxZDhjMGExY2Fj8xOMNMUcEOhJ3gxsgjaRqc1qppk1) )/BrowseArticles.aspx?CatID=6&AspxAutoDetectCookieSu pport=1
16. MyWebSiteName.com: Browse Articles
About My Company Ltd., it's services, pumps and company
Terms matched: 1 - Score: 19 - URL: http://localhost:1124/MyWebSiteNameDotCom/(X(1)A(zpypEaVSyAEkAAAAOTk0YWE3ZDUtODdlNy00MTQzLWI xOWQtYTFjMmViNDdjZDZiwyndthPmDPpOtoUMUcmS7piP4lU1) )/BrowseArticles.aspx?CatID=4&AspxAutoDetectCookieSu pport=1
17. MyWebSiteName.com: Browse Articles
About My Company Ltd., it's services, pumps and company
Terms matched: 1 - Score: 19 - URL: http://localhost:1124/MyWebSiteNameDotCom/(X(1)A(9yOrEaVSyAEkAAAAYzlmMDBjYWUtMTk0Ni00OTRhLTh mY2MtZDhmYWU1NzM4MDhh5V3LQQOtoEuUbSHliqLnzqNaYto1) )/BrowseArticles.aspx?CatID=11&AspxAutoDetectCookieS upport=1
Although these all link to different pages the search results do not give any indication of what they are linking to.

Has anyone else noticed this? Im not sure whether other search engines will index in the same way.

As it is easy enough to expose the header information of the master page to it's content page I am planning to just create a MasterBase class that allows title/description etc to be overwritten. This way for my articles I can override the title as say MyWebsiteName: ArticleTitleHere and description as my article abstract.

Be good to hear other peoples opinions on this.

retroviz November 3rd, 2007 02:07 PM

Just thought i would post my solution for this. SEO is a huge topic but i do believe these changes do make TBH more indexable.

[u]Page Titles</u>

Like many of you I aim to use the TBH structure for other websites. Currently all my content pages have their Title property set to "MyWebSiteName: PageName". I think this looks good but as the size of the site grows it will be a real pain if you then decide to name your site something different or use the same template for another site.

In addition to this (as already discussed), when I view different articles within my site, I don't want every one to have a page title of "MyWebSiteName: Show Article". I want it to appear as if they are viewing a completely different page in my website (rather than dynamically driven content from a database.

[u]META Description Attribute</u>

Similarly to the Title, I dont want every page to have the same "Decription" <meta> atttibute. Many search engines use the description data when showing search results. If there is a link to a page regarding a specific product, I do not want my description to show as "Welcome to MyWebSite.com, on this site we do all sorts....". I want it to be associated with the page being displayed.


First thing was to add 2 new properties to my custom configuration section in Web.Config:


<retroWebSection defaultConnectionStringName="LocalSqlServer" webSiteName="MyWebsite.Com"
                 webSiteDescription="Some description">

Then I added 2 new properties to my RetroWebSection Class in App_Code/ConfigSection.vb.
I set a default value for the PageTitle property so that if one was ommitted from web.config I can show the name of my template:


        <ConfigurationProperty("webSiteName", DefaultValue:="RetroViz.Cms")> _
        Public Property WebSiteName() As String
                Return CStr(Me("webSiteName"))
            End Get
            Set(ByVal value As String)
                Me("webSiteName") = value
            End Set
        End Property

        <ConfigurationProperty("webSiteDescription")> _
        Public Property WebSiteDescription() As String
                Return CStr(Me("webSiteDescription"))
            End Get
            Set(ByVal value As String)
                Me("webSiteDescription") = value
            End Set
        End Property

Once added I can access both properties (or values from web.config) from



Fairly simple :D

Now I needed to dynamically add the title and description attributes when required. One thing I took into consideration is that I only really wanted to override the Page Title property on my ShowArticles.aspx?.. pages so needed some way of preserving the Title values for other pages.

I decided to add a MasterBasePage class (similar to BasePage) that my MasterPage.Master page can inherit from. In there I defined two public properties for PageTitle and PageDescription that can be accessed by my ContentPages as well as the code to dynamically change some <meta> tags in the head of the page:


Imports Microsoft.VisualBasic
Namespace Retro.Web.UI
    Public Class MasterBasePage
        Inherits System.Web.UI.MasterPage

        Private _pageTitle As String
        Private _pageDescription As String

        Public Property PageTitle() As String
                PageTitle = _pageTitle
            End Get
            Set(ByVal value As String)
                _pageTitle = value
            End Set
        End Property

        Public Property PageDescription() As String
                PageDescription = _pageDescription
            End Get
            Set(ByVal value As String)
                _pageDescription = value
            End Set
        End Property

        Protected Overrides Sub OnLoad(ByVal e As EventArgs)
            If String.IsNullOrEmpty(PageTitle) Then
                _pageTitle = Me.Page.Title
            End If
            If String.IsNullOrEmpty(PageDescription) Then
                _pageDescription = Globals.Settings.WebSiteDescription
            End If
            Me.Page.Title = Globals.Settings.WebSiteName + ": " + _pageTitle
            Dim metaTag As HtmlMeta = New HtmlMeta()
            metaTag.Name = "Description"
            metaTag.Content = _pageDescription

        End Sub
    End Class
End Namespace

Then in the code behind for my MasterPage:


Namespace Retro.Web.UI
    Partial Class MasterPage
        Inherits MasterBasePage
    End Class
End Namespace

And thats it.

If I load my Default.aspx I get my website name and the Title property set in the ContentPage definition i.e. "MyWebSite.Com: Home". If I view the source for the page I can see the Description META information is the text set in my web.config file.

For my Article pages, I first need to add the following to the top of my ShowArticles.aspx page to allow the MasterPage properties to be accessed:


<%@ MasterType VirtualPath="~/MasterPage.master" %>
Then I can add the following to Page_Load event:


                Master.PageTitle = article.Title
                Master.PageDescription = article.Abstract

Now when I re index with Zoom Search, not only do I get a title that relates to the actual article, but also the related description from the Abstract field of that record.


quote:100 results found.

10 pages of results.
21. MyWebSite.Com: Launch of new website!
MyWebSite.com has been completely revamped. Our new site will help you to find the pump application you require and give you access to online s...
Simple as that. If anyone has any further suggestions or improvements that could/should be made then please do comment. It's in VB.net so you may want to translate if working with the C# version. My namespaces are the same as TBH but its Retro.Web.UI instead of MB.TheBeerHouse.UI (and so on and so forth)


oooshola November 5th, 2007 04:11 PM

As a side note, if you really want to be indexed well by google do the following:

For all your articles, set Page.Title to include the article's title (which is explained above). Google hates pages that look similar to other pages. So, as a corollary, Google tries not to index pages who's location looks like duplicates, i.e.: "...showarticle.aspx?ID=xxx" because not only do all of these pages look similar, but:

1) the crawler dislikes crawling database driven pages like this, since there can be millions that it has to crawl
2) google tends to avoid crawling pages that specifically use "ID=" in the query string, which is frequently used on the net to show a database driven page (like TBH articles).

So, I would also recommend using url rewriting. Here's a tutorial for it here:
I've implemented it on my site, and the number of my pages crawled by Google afterwards tripled in a couple of weeks. Simply making it look like "...showarticle1482.aspx" instead, will spark this improvement.

vantoko November 5th, 2007 04:55 PM

thanks for the tips.
I will try to implement them

ooshola, regarding the redirecting, does the submit function still work (adding comments etc)

one tip I would add (is already mentioned this in the forum) is to use the css friendly control adapters.
this provides cleaner html output

also run the site against a validator (http://validator.w3.org/). A valid site is always better processed than in invalid site

All times are GMT -4. The time now is 07:10 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.