Search  
Friday, September 03, 2010 ..:: Modules » Rewrite ::.. Register  Login
 Links Minimize

      

 About Rewrite Module Minimize

Purpose:

  • To Create a way to Modify the Url Rewrites within the web site
  • To have separate Url Rewrites for each portal and common rewrites on a Global basis.
  • To allow for the Url's to optionaly be rewriten or redirected.
  • To Allow for new Rewrite engines to be added to the framework.

      

 Issues Minimize

Version 2.1 and above now has a built in fix for this issue.


I have completed working on a new module that takes place of the UrlRewrite Module in version 3.0.11 to 4.02
One of the purposes of this module was to allow simple rewrites of existing tabs for various
reasons such as in the case when you port you old website into the DotNetNuke and you need to be able
to use the same links for backwards compability. So a url such as http://www.yourdomain.com/books.aspx
can be re-writen internaly as http://www.yourdomain.com/default.aspx?tabid=22 when you upgrade the page to DotNetNuke so the end user never knows the difference. This module moves all of the rewrites into the database with the ability to have global rewrites as well as portal rewrites.
When I create a redirect I want to allow the menu of DotNetNuke reflect that same rewrite
so instead of the menu pointing to the default friendly url I want to point it to my own friendly url.
In the above case I would want the menu to point to http://www.yourdomain.com/books.aspx.
I found only one way to do this in the current version and that was to point the tab link type to
"Url (A link to an external resource)" and then enter in the value http://www.yourdomain.com/books.aspx.
This works fine for the most part but it sure would be nice to be able to store the url as "~/books.aspx" instead of having to store the full url.
Ok Now for the bug: When you try and edit a modules settings on a page that is rewriten in this mannor I get an excpetion

DotNetNuke.Services.Exceptions.ModuleLoadException:
Object reference not set to an instance of an object. --->
System.NullReferenceException: Object reference not set to an instance of an object. at
DotNetNuke.Modules.Admin.Modules.ModuleSettingsPage.BindData() in
G:\Solutions\Webs\Examples\DotNetNuke3\admin\Modules\ModuleSettings.ascx.vb:line 237
at DotNetNuke.Modules.Admin.Modules.ModuleSettingsPage.Page_Load(Object sender, EventArgs e) in
G:\Solutions\Webs\Examples\DotNetNuke3\admin\Modules\ModuleSettings.ascx.vb:line 317
--- End of inner exception stack trace ---


What I found is that Pages that point to an external url are not loaded in the moduleSettings.ascx.vb

To correct this I only had to change one line of code in the ModuleSettings.ascx.vb file
in the Page_Load event Line 300 for version 3x and Line 234 for version 4x From

cboTab.DataSource = GetPortalTabs(PortalSettings.DesktopTabs, -1, False, True, False, False, True)
To 
cboTab.DataSource = GetPortalTabs(PortalSettings.DesktopTabs, -1, False, True, False, True, True)

The cboTab.DataSource now includes the externl Url tabs with it and no longer errors thus allowing us to enter in external urls that point back to the current website.

I am not sure if this is the best way to accomplish this or not but I do see a need for a way to handle friendly url's other then the default built in ones.

      

Copyright 2002-2005 BigByte Technologies   Terms Of Use  Privacy Statement