virtual static pages

D

DotNetJunkies User

Hi there,

I need to convert my ASP.NET site from a dynamic querystring site to a static site. Obviously I still want all the dynamic functionality but want all search engines to be able to spider my site.

Can anyone point me in the direction of a full and decent article on this technique as I am having trouble finding useful information.

thanks
RuSs
 
R

Russell

Scott Allen said:
Hi Russ:

This is something you can do with URL rewriting.

See:
URL Rewriting in ASP.NET
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp

Also Scott.

It seems that the way to do it is with <lookFor> and <sendTo> parts in
the web.config. My site has a content manangement system behind it
that allows users to add pages to the site so a new page might be
http://<my site>mainPage.aspx?pageID=<new ID>. So does that mean I
have to constantly add (and remove as users can delete pages) the
<lookFor> and <sendTo> parts in my web.config. Or is the solution just
to choose a certain few pages that I know will remain contstant (ie.
http://<my site>/AboutUs = http://<my site>/mainPage=37) and just add
the <lookFor> and <sendTo> parts for these contant pages. Or is there
a dynamic way to add new <lookFor> and <sendTo> parts?? Sorry for all
the questions.

thanks
RuSs
 
S

Scott Allen

Hi Russ:

I think it really depends on how you write the logic in the
HttpHandler. Some HttpHandlers are written to intercept and parse
every incoming request and there is no configuration to tweak in
web.config. So you should be able to write a handler that just looks
for /mainPage/ in the URL and then direct the request to the correct
resource internally.

Here are some open source applications that I know use some form of
this technique. Looking at the source could give you some additional
ideas:

Community Starter Kit
http://asp.net/StarterKits/DownloadCommunity.aspx?tabindex=0&tabid=1

..Text
http://www.gotdotnet.com/Community/Workspaces/Workspace.aspx?id=e99fccb3-1a8c-42b5-90ee-348f6b77c407
(.Text uses regular expressions in the web.config to determine
matching URLs)

Jeff Prossie also has a URL rewriting article with very simple code:
http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309pj_l/asp200309pj_l.asp

HTH!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top