Forum Moderators: open

Message Too Old, No Replies

optimizing .net sites

problem optimizing .net sites

         

unionjack

5:55 pm on Apr 24, 2008 (gmt 0)

10+ Year Member



Has anyone had issues with SEO and S.E. positioning with .net websites?
I would like to hear about successes/failures and any tips that could be offered.
I have heard that it's hard to get good SEO results with .net.

Response

1:39 pm on Apr 25, 2008 (gmt 0)

10+ Year Member



Hi Union Jack,

I've not actually seen anything inherit within .NET that would reduce its viability for SEO. What I have experienced, is poor deployment strategies when converting ASP Classic to ASP.NET. Below is the Page Load event I use for a custom 404 page when converting sites.

The SendMail is a custom library method that sends out e-mail. You can insert your own method there. This code will handle 404 errors, make a determination if the user was looking for a .ASP page, attempt to find the new ASP.NET page and use a 301 redirect to send them to it. It also reports referring sites that have links to the old pages. Hope it helps with your .NET projects.

-Response


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim ErrQS As String = String.Empty
Dim ErrScript As String = String.Empty
Dim NewPage As String = String.Empty
Dim Target As String = String.Empty
Dim AppPath As String = HttpContext.Current.Request.PhysicalApplicationPath

' Testing check
If (Request.QueryString.Count = 0) Then Return

' Parse out script name
ErrQS = Split(Server.UrlDecode(Request.QueryString.ToString), ";")(1)
ErrScript = Replace(ErrQS, ":80", "") ' clean out Port 80 text
ErrScript = Replace(ErrScript, "[This Site's URL]", "", , , CompareMethod.Text) ' clean off HTTP and domain text

' ASP Classic Test
If (Right(ErrScript, 4).ToUpper = ".ASP") Then
' ASP Classic file referenced
' Attempt to locate new ASP.NET file
Target = AppPath & Replace(ErrScript, "/", "\") & "x"

' New Page exists test
If File.Exists(Target) Then
NewPage = ErrScript & "x"
Response.Status = "301 moved permanently"
Response.AddHeader("Location", NewPage)
End If

End If

' External referrer test and e-mail alert
If (Request.UrlReferrer IsNot Nothing) Then
If Not (Request.UrlReferrer.Host.Equals(Request.Url.Host, StringComparison.InvariantCultureIgnoreCase)) Then
Dim Subject As String = "Invalid Link from Referrer"
Dim Body As String

Body = "Invalid external link:" & "<BR/>"
Body = Body & "Site: " & "[Your Site Name Here]" & "<BR/>"
Body = Body & "Link: " & ErrScript & "<BR/>"
Body = Body & "Referrer: " & HttpContext.Current.Request.UrlReferrer.Host & "<BR/>"

SendMail("[SMTP Server]", "[To Address]", "[From Address]", Subject, Body)
End If

End If
End Sub

dvprez

4:47 pm on Jun 22, 2008 (gmt 0)

10+ Year Member



my .net site shows up #1 for very many search phrases - gets between 30,000 - 40,000 unique visitors per day.

mrMister

1:42 pm on Jun 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A well programmed .Net site will not suffer any adverse effects in the search engines. However, there are many many pitfalls that an inexperienced programmer can fall into which will make your search engine ranking bomb. Make sure you get someone who know's what they're doing to write your .Net site. There are too many cowboys about. Be especially aware of anyone who once used to be an applications developer and has since turned their hand to web development.