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...Building ExtensionsBuilding ExtensionsProvidersProvidersURL Rewrite providerURL Rewrite provider
Previous
 
Next
New Post
6/19/2012 2:47 PM
 

Hi Folks,

I'm new to the provider stuff, so need your advise to kick off. My need is to create a module (provider) that converts the URL string from ugly format to nicer one, e.g.

from: example.com/default.aspx?tabid=55&ModuleId=422&EntryId=1326&Title=NiceArticle or
example.com/Home/tabid/55/ModuleId/422/EntryId/1326/Title/NiceArticle.aspx

to: example.com/55_422_1326_NiceArticle.aspx or example.com/NiceArticle1326.aspx

Any ideas on where do I start?

Thanks in advance!

 
New Post
6/19/2012 11:05 PM
 
the wiki has some good guidance and links -http://www.dotnetnuke.com/Resources/Wiki/Page/Friendly_URL_Providers.aspx

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
7/11/2012 4:29 AM
 

I've read a lot of stuff like wiki, ifinity blog and some others, but still can't get to a starting point. They talk about creating friendly URLs, but not how to implement translation mechanism - the one that makes DNN understand how TabId, and other stuff I want works...

Anybody having a good link on how to start Rewriting?

Thanks!

 
New Post
7/11/2012 1:47 PM
 
all urlrewriters essentailly work the same i.e. they read the path and then apply some rules to do a context rewrite. You can apply whatever rule logic you want, but in general the quickest/easiest way to do so is via regular expressions e.g. if you look in config/siteurls.config you can see the rules used by dotnetnuke (you can even add your own rules here if you only want to do a little tweak)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
7/12/2012 8:32 AM
 

OK, I've got the idea.

As I'm new to regex, I've opened the Config\SiteUrls.config and added the following rule:

<RewriterRule>
        <LookFor>.*(\d+)_(\d+)_(\d+)\.aspx</LookFor>
        <SendTo>~/?TabId=$1&amp;ModuleId=$2&amp;EntryId=$3</SendTo>
</RewriterRule>

which should convert 
    http://localhost/dnn/55_430_5.aspx
into
    http://localhost/dnn/?tabid=55&moduleid=430&entryid=5

but it doesn't... All it says is

The resource cannot be found.

Any help appreciated!

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsProvidersProvidersURL Rewrite providerURL Rewrite provider


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