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 ...Best way to rewrite a URL? Is there something built-in?Best way to rewrite a URL? Is there something built-in?
Previous
 
Next
New Post
7/13/2010 3:17 AM
 
You might like to look at this product too - http://www.snapsis.com/DotNetNuke-Per...

Nina Meiers

Nina Meiers My Little Website
If it's on DNN, I fix, build, deploy, support,skin, host, design, consult, implement, integrate and done since 2003.
Who am I? Just a city chic, having a crack at organic berry farming.. and creating awesome websites.
 
New Post
7/13/2010 9:07 AM
 
Bruce,

Thanks for your reply but that's not what I'm trying to accomplish here. I'm never going to be redirecting from the ASPDNSF site to the DNN site. I'm going to have a couple of custom DNN modules that displays products from the ASPDNSF database into the DNN site. When you click on the product in the custom module, I want to redirect from productlist.aspx  to productdetail.aspx (both in the DNN install) but show the URL as ASPDNSF does.

So on productlist.aspx in the DNN install I'll have a GridView of products, theses products can be ever changing. When you click on the product, it will redirect to productdetail.aspx (also in the DNN install) but I want the URL to say p-productid-productname.aspx (where productid and productname are the id & name of the clicked on product) instead of productdetail.aspx. 

So in essence, I want to rewrite productdetail.aspx to p-1-product-one.aspx, p-2-product-two.aspx, p-3-product-three.aspx...etc depending on what product was selected in the GridView.

Thanks to everyone for their help and I'm sorry I made this so confusing.
 
New Post
7/13/2010 9:40 AM
 
Bruce,

So if I understand the last part of your post, we can set something up like
<rule>
   <url>/p-([0-9]*)-(.*)\.aspx(?:\?(.*))?</url>
   <rewrite>/productdetail.aspx?ProductID=$1</rewrite>
</rule>
using your product?

Then, no matter what product is clicked, it will rewrite the URL the way we want it?
 
New Post
7/14/2010 5:30 AM
 
Almost - except there is no page called 'productdetail'.   Any DNN page with a Url productdetail.aspx is a virtual Url - it doesn't actually point to any file on the server. 

What you want is

<rule>

   <url>/p-([0-9]*)-(.*)\.aspx(?:\?(.*))?</url>

   <rewrite>/default.aspx?tabid=xx&ProductID=$1</rewrite>

</rule>

Where xx is the tabid of your 'product detail' page in DNN.  Check and copy the other DNN rewrite rules to see if it should be default.aspx, /default.aspx or ~/default.aspx in the rewrite rule.

Finally, this is standard DNN.  It will work with the Url Master module, but it's not necessary to have it (and you would have to instruct Url Master to go straight to siteurls.config rules for those Urls).  Because you're just implementing a rewrite, the standard provider can handle that OK.

 
New Post
7/14/2010 10:05 AM
 
Thank you so much Bruce!!! That worked like a charm.

That was a lot easier than I made it out to be. I apologize to everyone for making that as difficult as I did.

Thanks again!!!
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Best way to rewrite a URL? Is there something built-in?Best way to rewrite a URL? Is there something built-in?


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