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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Rewriting URLsRewriting URLs
Previous
 
Next
New Post
7/8/2008 4:23 PM
 

I've looked around but couldn't find quite this problem, I also wasn't sure how to phrase a question for it.... anyway:

I have a client who is interested in migrating to a DNN-based system, however they want for their URLs to be more friendly. Ideally, they would like something like:

http:///www.example.com/classifieds/cars.html
http://www.example.com/classifieds/trucks.html
http://www.example.com/articles/local/news.html

Of course, .ascx would be acceptable. I'm sure this is something rubber-helmet easy I'm overlooking.

Thanks!

~SB


Wells Doty Jr
Online Content Development
 
New Post
7/8/2008 5:10 PM
 

It took me a long time to find the solution, and I have promptly forgotten it.

In the web.config you need to enable friendly URLs by finding this section
    <friendlyUrl defaultProvider="DNNFriendlyUrl">
      <providers>
        <clear />
        <add name="DNNFriendlyUrl" type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" />
      </providers>
    </friendlyUrl>
and adding urlformat="HumanFriendly" so that it looks like
    <friendlyUrl defaultProvider="DNNFriendlyUrl">
      <providers>
        <clear />
        <add name="DNNFriendlyUrl" type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" urlformat="HumanFriendly" />
      </providers>
    </friendlyUrl>

it will still be aspx as the suffix. There might be a way to change it to HTML, but I don't know that piece.

 
New Post
7/8/2008 5:45 PM
 

You can use the UrlRewrite capability that is already in DotNetNuke.  However, I would suggest staying away from HTML using this method.   The rewrite urls are managed in two places: the Host Settings, or the SiteUrls.config.  I prefer to use the SiteUrls.config directly, but use whatever method you prefer.

For your examples, you want to first figure out the tabid of each page that you want to create the redirect for.  Let's assume that they are 123, 124, and 125, respectively.  Here is how you would input the values into the UrlRewrite to create this ability.  Add the following values:

LOOK FOR
.*/classifieds/cars\.aspx$
REPLACE WITH
~/Default.aspx?tabid=123

LOOK FOR
.*/classifieds/trucks\.aspx$
REPLACE WITH
~/Default.aspx?tabid=124

LOOK FOR
.*/articles/local/news\.aspx$
REPLACE WITH
~/Default.aspx?tabid=125


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
7/9/2008 6:06 AM
 

I've struggled with the same problem.

i wanted adress like www.mysite.com/contact etc.eventually i ended up creating the actual folder an putting an redirect in a Default.asp file. like this, might not be pretty, but it's not overly complicated.

<%@ Language=VBScript %>
<%
' Permanent redirection
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.mysite.com/Home/Contact/tabid/78/Default.aspx"
Response.End
%>


www.rjdejong.net
 
New Post
7/9/2008 10:48 AM
 

I personally recommend using UrlMaster, as it provides an easy to handle interface, and can do all redirections needed.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Rewriting URLsRewriting URLs


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