Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedI need to "slightly" extend the functionality of the built-in UrlRewrite HTTPModuleI need to "slightly" extend the functionality of the built-in UrlRewrite HTTPModule
Previous
 
Next
New Post
12/22/2010 6:16 PM
 
Hi,

I have added some code to the HTTPModules DNN Source project in the UrlRewriteModule.vb file.

All it does is the following in one location in a few dozen lines of code:
1. temporarily hijack each request,
2. check the requested URL against some Cache
3. If there is a match, Call RewriterUtils.RewriteUrl
4. Hand the request back to the rest of the code. It often gets rewritten twice (once with my new code, once again with the native code), because this method allows me to redirect   domain.com/stores/my_super_pretty_product.aspx to domain.com/products.aspx?StoreID=12&ProductID=15. Since I'm handing it back to the "regular" DNN rewrite code (instead of replacing it), that URL then gets rewritten to domain.com/DEfault.aspx?TabID=73&StoreID=.......

This works quite nicely, but it will make it hard for me to upgrade DNN, since I have updated some core DNN stuff here.

Is it possible for me to override a function with my own version (an extension perhaps?) while calling the original as well? Please keep in mind, I like the default functionality... I just want to add this quick Cache-Lookup first.... and I really don't have to have to try and bring in all of the core DNN code into my own extension.

I'd like to do something like the following in my own sort of extension or something:

Public Overrides Sub RewriteURL(...)
   .... do my cache check / potential rewrite ...
   MyBase.RewriteURL(...) 'Now, execute the standard code
end sub

Sorry for the poorly written question. Doing the best I can... the extent of my DNN programming has been with custom modules. I'm still a bit overwhelmed by extensions.

Thanks



 
New Post
12/26/2010 3:01 PM
 
You should look into writing your own FriendlyURL Provider for DNN, starting with the core project, rename the namespaces and such for your new one, that way you don't get things overwritten when you upgrade DNN.

Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
12/27/2010 9:49 AM
 
Chris Hammond wrote:
You should look into writing your own FriendlyURL Provider for DNN, starting with the core project, rename the namespaces and such for your new one, that way you don't get things overwritten when you upgrade DNN.

 
Chris, the sounds like a great idea. Thanks for the solution!

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedI need to "slightly" extend the functionality of the built-in UrlRewrite HTTPModuleI need to "slightly" extend the functionality of the built-in UrlRewrite HTTPModule


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out