saunderl
saunderl

Reputation: 1638

how to get search engines to understand a DB driven asp.net site

All,

This would seem like a fairly basic asp.net question - but in all my years of coding, I've never really thought about it.

Say you have a asp.net 2.0 site with only a masterpage and a default.aspx and its a blog that saves all the data into the database. Links on the side are generated automatically. So ... the URL is always just http://www.XXXXX.com/default.aspx.

So, with that being the case, what do you need to do so that ... say google ... knows about all the different blog entries and links directly to the entries instead of just the base URL?

Is it as simple as changing the forms method to: method="get"?

Thanks, L. Lee Saunders

Upvotes: 1

Views: 102

Answers (4)

RickNZ
RickNZ

Reputation: 18654

There are at least two solutions:

  1. Search engines understand query strings, so just add the article IDs to the URLs in your anchor tags -- no need to even use a form control.
  2. Use URL rewriting to expose one set of URLs to the outside world (like /article-title/1234/) in your anchor tags, and then modify the URL to be default.aspx when it arrives at your site; the page could then pull the article to be displayed from any number of places, including but not limited to a query string.

Upvotes: 1

Russ Bradberry
Russ Bradberry

Reputation: 10865

some sort of URL rewriting may be an answer

I wouldn't recommend a postback for your situation, it can get ugly for refreshes etc. So, yes, change the method to "get"

Then, say your page of, default.aspx?postid=12345 will get translated into /mm/dd/yy/this-is-my-post.aspx

Upvotes: 0

Robert W
Robert W

Reputation: 2961

Create a page that just serves up XML Sitemap (the data obviously being pulled from your database) and submit the sitemap to Google.

Google will then index any links in your sitemap.

(This assumes that these is some difference between each article - e.g. a Querystring key/value).

Useful Link(s):

Upvotes: 1

James Black
James Black

Reputation: 41858

You could have a REST webservice so that you can just use urls to navigate the site, and perhaps have a front page with some new posts, so that the spider can navigate the site..

As an example, look at the urls for SO, it is easy for a spider to navigate this database-driven website.

Upvotes: 1

Related Questions