4
votes

I am trying to do URL Rewriting from Global.ascx file but every time it redirects to Default.aspx page and ignores the Tab id as i am doing it in DotNetNuke ver. 06.01.03 (108). Here is the code:

if (CurrentURL_Path.Contains("scientific-cameras"))
{
    HttpContext.Current.RewritePath("~/Default.aspx?TabId=105");
}

I have created a page abc.aspx

I want that if "scientific-cameras" is contains in the url then it redirect to the page (abc.aspx) and 105 is TabId for abc.aspx.

2
Can you edit your question a bit and elaborate? As it stands there's too little info for us to help you. In addition to extra details about your problem, can you add the things you've tried to solve the problem, and why those solutions didn't work? Finally, can you mention the version of DotNetNuke (and whether it's your own build or not) you're using? - Jeroen
does the new URL exists on the server? - Shezi
Why don't use Web.config to achieve the same? - abatishchev

2 Answers

0
votes

More than likely this is a conflict with the DNN stuff. There is already a friendly URL structure in DNN. I would recommend using this rather than doing your own, as you don't want too many cooks in the kitchen.

You can specify custom URL's in "Host" -> "Host Settings" -> "Friendly URL Settings".