开发者

Best practices for converting an existing website into a website with SEF URL

I've got a website that was created about an year ago and its been constantly revised since then. The website is coded in classic ASP, contains about ~50 pages -- some are multi-purpose, and contains old-school style links such as:

/news.asp?PageIndex=4
/news.asp?SearchString=Obama
/news.asp?SearchString=Obama&PageIndex=4
/news.asp?NewsID=1

I have IIRF v2 insta开发者_StackOverflow社区lled which allows access to URL rewriting functionality so this I do not have to worry about. What I am worried about is how to replace about 300 links to .ASP pages with SEF urls. As far as my understanding is concerned, I have to add a database query (to extract title of the record being linked) for each link.

I need advice on how to begin converting the website into a SEF URL powered website with as little code change as possible. Wrapper classes and tried-and-tested techniques and pointers to best practices will be appreciated.


If you want to do URL Rewriting without changing frameworks or anything, may I suggest that you take a look at IIS7 Url Rewriting Module?

However, if you are rewriting part of your application in .NET ... you might want to consider ASP.NET MVC. It already build simple built-in URL Rewriting module and definitely allows you to keep on using your old "WebForms" (if ASP.NET) or your classic ASP pages.


Don't forget to permanently redirect each and every old link to a new one (use 301 HTTP code).


At news.asp (and whatever other old pages you have) put something (a class? I don't know, I have never used ASP) that parses the old-style URL and redirects (with a HTTP redirect code) to the new URL.


I'm not trying to be funny here but seriously how long would it really take to convert 300 links manually? I really suspect that it would take less time than trying to find some automated approach.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜