views:

64

answers:

1

Using { ASP.NET 3.5 , Windows Server 2003 , IIS 6 }

I'd like to optimize my site for SEO. For the sake of example, I have a site with three pages:

  • /news.aspx - a page that lists news articles
  • /events.aspx - a page that lists events
  • /location.aspx - a page that determines user's geographic location

If user visits /news.aspx or /events.aspx without going to /location.aspx first, he sees unfiltered content (all news articles or all events). To narrow that down, the user goes to /location.aspx. The location page lists states that the user can click. When user clicks a state, he gets a list of cities. When user clicks a city, he get a list of streets. When user clicks a street, he is taken back to /news.aspx, but the content he sees is now filtered by location. Same thing goes if the user clicks on the /events.aspx page.

I can do all this through session or cookies, but, for SEO, I have search bots to contend with. I'm pretty sure URL re-writing is the way to go, but the examples I'm finding (and they are a-plenty) deal with simple stuff like /products/umbrellas or /books/authors/spolsky. It -feels- more complicated than that (maybe it's more simple... set me straight).

My initial thought is that I need some form of URL rewriting handler or module so that I can begin using urls like mysite.net/WA/Seattle/Pike_Pl. Then, once the location is determined, all the internal urls in the site would have the location in them... to get to /events.aspx, the link would actually point to mysite.net/WA/Seattle/Pike_Pl/events.aspx. The handler would get the location information out of the url path and rewrite the url to /events.aspx?state=WA&city=Seattle&street=Pike_Pl. The same would go for /news.aspx or any other location sensitive page in my site.

If you've done something similar, code examples would be appreciated.

Byron

+1  A: 

Wouldn't it be easier to just create a control that can be placed on all of the mentioned pages, allowing for "in-place" filtering?

Then the matter of the url rewriting. I would have the urls look like the following:

Both the events and news page would have the control "SetLocation.ascx" on it. Now there is no need to first visit the location.aspx page, use the control to get these settings.

THen use any of the available open source UrlReWriters available to catch urls like http://siteurl.com/events/AREA/CITY/STREET and http://siteurl.com/news/AREA/CITY/STREET and have them be mapped to an internal url with regular expressions (which most if not all urlrewriters use) like so:

<rewrite url="~/Events/(.+)" to="~/Event.aspx?area=$1" />
<rewrite url="~/Events/(.+)/(.+)" to="~/Event.aspx?area=$1&amp;city=$2" />
<rewrite url="~/Events/(.+)/(.+)/(.+)" to="~/Event.aspx?area=$1&amp;city=$2&amp;street=$3" />

Then use an url like http://siteurl.com/event/EVENTNAME to point to an actual event (note the missing 's' after /event in the url). Save the currently selected area/city/street in the session and update it when the user changes it using the SetLocation.ascx control.

Colin
Great suggestions. How could a search bot index content for all areas if there isn't a page where locations are chosen by links. I'm still learning SEO, so forgive the newb-ness.
Byron Sommardahl
Create a page that just contains all possible area/city/street links to both news and events, include that in a google sitemap or a robots.txt file.
Colin
Also, you could make the SetLocation control work with simple links, so google can follow those itself liek a regular user.
Colin
Thanks. Great ideas.
Byron Sommardahl