A few days ago I discovered through Google Webmaster Tools that some of my sites were unreachable by Google. In particular Google reported my homepage as unreachable and many of my sub-pages returned the same 403-6 error.

After checking my website both with various browsers and response grabbers located around the world I determined that the problem was definately not with the way I had designed the website or configured the hosting.

The HTTP 403-6 error means that an incoming request has been denied (Forbidden) because the IP address is banned or rejected in some way. Initially I tried to determine if this was because of some response error on my part; this was not the case.

I checked my server logs and could see the same errors showing up on every request that came from the GoogleBot (incidentally all requests were on the same IP). I notified my hosting provider and eventually the problem was rectified and the IP address used by GoogleBot at that point in time was unblocked.

I re-submitted my sitemaps and shortly afterwards the errors started to disappear from Google's Webmaster Tools portal. I hoped that I had got to the root of the problem in time.

The next day while routinely checking websites I discovered that the homepages had disappeared from Google's search results. Initially I thought that the sites had dropped on their keyword matches but "site:URL" checks showed the actual pages had been dropped.

It has taken 2-3 days for these pages to reappear in the search results and I am still waiting for some pages to come back in. Personally I found the timing to be very bad as I am trying to build Google's confidence in my websites.

This all points to one of my main tips for SEO. It doesn't matter about anything else if Google etc cannot see your website. Choose your hosting company carefully.

AR

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

I've uploaded a copy of the code in a demo website for the pagerank tool in C#.

You can download it from: Full PageRank code with demo site

I've tried out a few websites and URLs that people have posted to me and got mixed results. I will be updating it if I can find fixes. In particular the hash seems to fail on some sub-directories.

Download it and try it out for yourself. Feedback is always welcome and drop a comment while you're here.



UPDATE

The previous code was being blocked by Google for some requests due to a mis-calculated hash. This has been fixed now and the download updated.

You can also checkout my online demo at (not currently live)



UPDATE

I've been asked by Aaron Brown to provide a VB.net version of this code or at least of the StrToNum part. I'll take a look at this shortly. Or if you have partly-working code, send it over and I'll see if I can help out.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Generate XML sitemap for Google

Published 7/19/2007 by Aaron in Downloads
There are many sites that deal with returning a Google sitemap from .NET pages. Most of these need you to adjust the IIS settings (yes this is about Windows hosting).

There are also some that deal with creating a sitemap on-the-fly from the web.sitemap file in your project but here I've included the code to return an XML sitemap that conforms to the Sitemap protocol that you can submit to Google without modifying IIS - something that should interest those of you who are on shared hosting.

The ZIP download is available at the bottom of this article.

Basically if you create a blank ASPX page and clear out all the HTML elements from the ASPX page you will just be left with the <% @Page %> definition. Below is an example of the only line that needs to be in the front file (.ASPX).

For your purposes, just add the ContentType="text/xml" section. It may NOT be necessary once you read through the page-behind code, but I've left it in as it doesn't hurt.

Example:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="XMLSiteMap.aspx.cs" Inherits="XMLSiteMap" ContentType="text/xml" %>


Next you will need to put the GSiteMap.cs file in your App_Code folder.

In the page-behind code, you can then simply call the class and all the work is done for you. The code uses the filesystem (whether it is running locally or on a remote server) to generate the sitemap. It will also return the correct protocol type (http or https) and the port number if not on port 80.

I have used this method before the generate an XML file in the filesystem but since my hosting provider doesn't allow ASPNET to write to the root directory of the site, returning the sitemap on-the-fly is the only truely automated method for this.

In the page-behind's On_Load event:

protected void Page_Load(object sender, EventArgs e){GSitemap _siteMap = new GSitemap();_siteMap.ProcessRequestFS(Context);}


This simply passes the current HTTPContext to the sitemapping class allowing it to replace the Response with your pure XML sitemap.

I won't go into the full code at this point because you can read through it yourself from the download. It's worth pointing out the following however:

private string[] _Allowed_Extensions = { ".aspx", ".php", ".asp", ".htm", ".html", ".txt", ".doc", ".pdf", ".jpg", ".gif", ".xml" };private string[] _Restricted_Directories = { "App_Data", "App_Code", "admin" };


1. Put any extensions you want to be indexed in the "Allowed Extensions" array.

2. Put any directories you don't want indexed in the "Restricted Directories" array.


Where the code pulls a list of files from each directory I initially used a file pattern, ie:

"*." + Extention


but found that some files were being indexed twice - this is because of a flaw in the framework that will return .ASPX files when you ask for .ASP files. For this reason I re-worked the code. It's less efficient this way but it's guaranteed to work.

The call to "ProcessRequestFS" iteratively goes through each directory adding files to the sitemap. If a directory is blocked by the "Restricted Directories" array then all sub-directories of that Directory are also blocked.

You can see an example of the output of this code by visiting: (not currently available)

On my site you may notice that I have temporary removed the optional tags from the sitemap. They are however created in the version available for download.

In particular, the priority tag is automatically down-graded for each directory further down the path that the script has to look.

There is no real error handling in this version but you can add that as necessary.

I checked with Google and Yahoo! and as far as I can see they have no problem with you adding a sitemap with the .ASPX extension.

The full code can be downloaded here: http://www.aaronreynolds.co.uk/page/Code.aspx

If you have any problems using the code, please let me know.

AR

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Silverlight and where it is now

Published 7/16/2007 by Aaron
I'm always looking for ways to improve the websites I develop for people and my new interest is Silverlight.

Microsoft table this as:
"Microsoft® Silverlight™ is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web."

It's only in it's early stages yet but it has the workings of being a very useful and powerful tool. There are many things I have noticed that it cannot currently do simply but it should be noted that companies like Adobe/Macromedia have been working of presentation technologies for the web for a good few years now.

Once of the main limitations in the current versions of Silverlight are the lack of input controls such as simple textbox entry and webcam support. It seems that initially the technology has it's focus on presentation of pre-made content and will couple quite nicely with Windows Media Server.

So if you are looking for a method to deliver content such as videos with a delicious and simple to create interface then look no further than using Silverlight. Adobe currently has a massive lead in this field but if Microsoft can eat into it like they have eaten into Search Engines and search features then there's a good chance that in 1-2 years even the most die-hard Flash developers will be considering Silverlight.

I think the current strength of the Silverlight offering is it's integration with Visual Studio that will allow C# developers and the like to vastly improve their content presentation. Lord knows that techies do not make the best-looking things.

I'll be initially looking at using Silverlight to stream videos from a Windows Media Server but I hope that when the newer versions of the Framework become available they will integrate webcams and use input to a useful and intuitive level.

You can't really say something is platform and browser-independent if you can't give the user the same experience across the board. My reason for saying this is that some techies are getting excited about Media encoding with Silverlight when it's not natively a part of the package. For me the two need to go hand in hand before I will recommend using Silverlight over Java or Flash media gathering when I know that my users may not be on Microsoft platforms.

It looks good Microsoft so please don't wimp out on us. This could be the start of something great.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

PHP, MySQL and even ASP grrr!

Published 7/11/2007 by Aaron
I'm not a PHP developer - never have been. I've had to fix problems in PHP sites before now and hence I've picked up a little knowledge of the language.

I've recently been helping my GF to rebuild something using MySQL and PHP and it makes me glad I moved on to using an IDE for server-side programming. It also makes me glad that I can use MS-SQL.

MySQL (we are talking about one of the web-based interfaces here by the way not the actual database) is pretty lousy-looking and difficult to find the features that you need. I know the database has many powerful features but the particular implementation I was using left a lot to be desired.

It's also been a few years since I used Dreamweaver to do any programming but without it I wouldn't have got far very fast in PHP. I'm sure that PHP is far more powerful than classic ASP - in fact I know it is because I've had to do some classic ASP recently. I don't miss using classic ASP though it has to be said.

When I offered to fax something to a friend recently they declined and said they didn't live in the 80s. Classic ASP, like faxes have their uses in todays world but I don't really wanna use them if I don't have to.

I would have to say that anyone moving into web-site server-side programming should look at both camps (PHP and language.NET) before deciding on their path because to be honest once you are used to using one language or system, you'll probably stick with it until it becomes obselete.

The question is when will ASP become obselete?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

AaronReynolds.co.uk

Aaron Reynolds - for C# and VB .NET, HTML, PHP, CSS, ASP, DNS and BIND, Windows Server 2003 etc...