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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Has anyone implement URL aliasHas anyone implement URL alias'?
Previous
 
Next
New Post
8/31/2006 12:39 AM
 

jlafon -

It will probably be easier to use something like-

www.mysite.com/user_profile/username because www.mysite.com/username will not contain a unique base url. You would then need to customize the redirect code to parse out the username. Then you would look up the userid and redirect or whatever.

If anyone has done something like this... I am looking for a similar solution. Thanks in advance.

 
New Post
9/8/2006 8:11 PM
 
I have done some similar url rewriting that parses out some params from the url and constructs the destination url. It was not a DNN site, but it is a fairly simple asp.net technique. I saw some nice url rewriting rule engines on codeproject if you want something more in depth, but since I only had one case to handle for the time being I just did a very small solution using Context.RewritePath().

In global.asax do something like:

protected void Application_BeginRequest(Object sender, EventArgs e)
{
    HttpApplication Appl = (HttpApplication)sender;
    string requestedUrl = Appl.Request.Path.ToLower();

    //avoid any further processing in the common case:
    if (!requestedUrl.StartsWith("/user/"))
    {
        return;
    }
    else
    {
        //parse out whatever value you're looking for from requestedUrl
        string redirectedUrl = ...;
        
        //send the client where they should go
        Appl.Context.RewritePath(redirectedUrl);
    }
}


-Adrian
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Has anyone implement URL aliasHas anyone implement URL alias'?


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