Hi Guys
Just weighing in on the thread now.
The product urls you are looking at are obviously from a ASPDNSF install separate from DNN - am I correct?
It's not clear to me what you want to do : do you want to redirect away from the ASPDNSF site to the DNN site?
so, site1 : example.com/p-1-product-name.aspx should actually go to example.com/product-detail.aspx?
For a start, you'll have difficulties in getting DNN to work with the same domain name as a separate ASPDNSF install. It's not impossible but will take some doing. Assuming you're using a different domain name for the DNN site (example1.com), then what you want to do is to show the page details in your DNN page from the other format of Url. That could be redirecting, or it could be rewriting.
Quote:
Can I use the SiteUrls.config file? I was able to redirect to the right page using this method but it swapped out the URL
<
RewriterRule
>
<
LookFor
>.*a-123-this-is-a-test.aspx(.*)</
LookFor
>
<
SendTo
>page.aspx</
SendTo
>
</
RewriterRule
>
It took the a-123-this-is-a-test.aspx that was in the link, redirected to the page I wanted it to, but didn't keep the a-123-this-is-a-test.aspx URL.
THis is not going to work. Despite the 'sendto' format, this is a rewrite rule, not a redirect rule. The standard DNN Url Rewriter cannot do 301 redirects.
There is no 'page.aspx' to rewrite the URl to. DNN can only understand one type of Url (ok, there are a few exceptions, but they don't apply here). The Url format that DNN works with is /default.aspx?tabid=xx.
So, if you want to
rewrite the Url from p-1-product-name.aspx to product-detail.aspx what you have to do is setup a rewriting rule that will find the Url, and then rewrite that to the correct tab id. So instead of 'sendto' of page.aspx, your sendTo value will be /default.aspx?tabid=xx where xx is the tabid for 'page.aspx'.
That should rewrite OK and allow you to provide the content of that page for that Url. You'll need to enter a Url for each separate product you want to support, and you'll have to create a one-to-one mapping of products in your system to DNN pages. If that's starting to sound like a lot of work, it's because it's the wrong approach because it is extremly inflexible, and unless you have a small number of products that never change, will prove to be unworkable in practice.
The right approach is to display the content on a single DNN page using a module. If you are writing a custom module to display the products in DNN, then you'll need to do some more with the Url. Specifically, you'll have to write a regex expressions that parses the 'a-1' into type=a&productId=1 in your Url. I won't try that here because I'd probably get it wrong but it's pretty simple from a regex point of view. You'll be rewriting to /default.aspx?tabid=xx&type=${type}&productid=${productid} or something like that. Then, in your custom module, you'll be reading the querystring for
type and
productId and displaying the correct content (presumably reading from a database). Note that this is all done with rewriting - no redirecting in sight here. You'll also want to hide your page with the custom module from the menu so it doesn't get indexed with the standard Url.
Quote:
Using iFinity URLMaster,I think you need to check the checkbox entitled "" and then specify a "-" as the space replacement character. That will do what you're after.
Rod is correct - this is how you put the hyphens into the Url, but the problem here is the confusion between redirects and rewriting.
If you set up p-1-product-one.aspx as a redirect in Url Master, it will redirect the request to the specified page, which is what you're seeing. You can effect the same thing by setting the status of the p-1-product-one URl in Url master to a '200' status, which will replace the Url for that page with p-1-product-one.aspx. In effect the productdetail.aspx Url will be replaced with p-1-product-one.aspx everywhere - inclduing in the menu. This is effectively the same thing as setting up a one-to-one mapping in the siteurls.config file for each product url with a product page (only much easier!).
Url Master can also do custom rewriting of parameters in a similar way to the siteurls.config file if necessary. But that's quite advanced and you'd need to get in contact with me via the website to set it up. You might want to post here exactly how you want it to work including domain names (use fakes if necessary), how dynamic the product listings are, and how many there will be. Those parameters will decide the best course of action for you.