Register   Login
     
  Latest Posts  
RE: Custom Templates
by bmurphy on 8/28/2008 8:21 PM
RE: Scott, Album layout
by samanderson4 on 8/28/2008 7:36 PM
RE: Show logo in dnn banners module
by kalak on 8/28/2008 5:25 PM
RE: Can'd add photo
by netprocity on 8/28/2008 5:23 PM
RE: DNN Search
by kalak on 8/28/2008 5:07 PM
RE: Can'd add photo
by smcculloch on 8/28/2008 4:40 PM
RE: Can'd add photo
by netprocity on 8/28/2008 4:34 PM
RE: Scott, Album layout
by smcculloch on 8/28/2008 4:20 PM
RE: Can'd add photo
by smcculloch on 8/28/2008 4:20 PM
Scott, Album layout
by samanderson4 on 8/28/2008 4:07 PM
  Forums  
Subject: Use .htm extension?
Prev Next
You are not authorized to post a reply.

Author Messages
Ade AllenUser is Offline
Registered Users
Nuke Super Newbie
Nuke Super Newbie
Posts:12

2/15/2007 2:39 AM  
Hi Scott,

I'm using the Human Friendly url provider with DNN 4.4.1 and a few custom modifications, and it's working great, many thanks.

I'm attempting to modify UrlRewrite to intercept requests to some legacy .htm pages, and have hit a bit of a wall.

I've successfully configured IIS and Web.Config so that .NET processes .htm files, and tested this works by renaming an .aspx page to .htm (and .htm.vb). All good so far, .htm pages are being processed just like .aspx pages.

I've successfully extended the UrlRewrite.vb with 2 new methods for identifying by product name (see http://www.golfalot.net/driver-reviews.aspx and http://www.golfalot.net/course-list.aspx?Region=South%2bWales).

Now I'm attempting to add another method (IndentifyByLegacyUrl), where I was hoping add all the redirects for the legacy htm pages.The golf_shop.aspx gets intercepted, and redirected, but the golf_shop.htm doesn't.

Web.Config httpHandlers section:

Web.Config buildProviders section:


I'm thinking that maybe the System.Web.UI.PageHandlerFactory is somehow bypassing the UrlRewrite, do you think could this be the problem, or is there something else I'm missing?

Any advice would be appreciated,

Ade.
Ade AllenUser is Offline
Registered Users
Nuke Super Newbie
Nuke Super Newbie
Posts:12

2/15/2007 2:40 AM  
Eek, the < code > section didn't quite do what I expected, sorry.

Try again:

Dim splitUrl() As String = url.Split(Convert.ToChar("/"))

If splitUrl.Length > 1 Then
Select Case splitUrl(1)
Case "golf_shop.aspx"
RewriterUtils.RewriteUrl(app.Context, "~/" & glbDefaultPage & "?TabID=63")
Return True
Case "golf_shop.htm"
RewriterUtils.RewriteUrl(app.Context, "~/" & glbDefaultPage & "?TabID=63")
Return True
Case Else
Return False
End Select
Else
Return False
End If
Ade AllenUser is Offline
Registered Users
Nuke Super Newbie
Nuke Super Newbie
Posts:12

2/15/2007 3:52 AM  
Little update: I've decided to take a different approach, and kill 2 birds with 1 stone by adding the legacy redirect functionality to a custom 404 handler instead.

Far easier, no messing the IIS scriptmaps :)
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:11386


2/15/2007 2:46 PM  
OK, good job, you done what I would ha ve tried anyway.

Scott McCulloch
Site Administrator
Ade AllenUser is Offline
Registered Users
Nuke Super Newbie
Nuke Super Newbie
Posts:12

2/16/2007 1:21 AM  
Thanks Scott, for the vote of confidence in my method :)
You are not authorized to post a reply.
Forums > Projects > Friendly Urls > Use .htm extension?



ActiveForums 3.7