Search  
Monday, March 15, 2010 ..:: Modules » Rewrite » Rewrite Help ::.. Register  Login
 Rewrite Documentation 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 new Rewrite engines to be added to the framework.
HttModule:
The HttpMModule is installed by Replacing the
<add
name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules.UrlRewrite" />
with
<add
name="UrlRewrite" type="BigByteTechnologies.Portal.HttpModules.Rewrite, BigByte.DnnRewriteHttp" />
in your web.config file.Rewrites will not take effect until this change is made.
Do Not
make this change until you upload the DnnRewrite module to you site first.
It is important to note that it is is a good idea to back up you web.config file before making any changes to it. If you decide to uninstall the Rewrite module then you will need to first reverse the changes in your web.config file as deleting the module also deletes the HttpModule from the Bin directory and will cause you site not to load.
Initial rules:
The current Rules installed when you add the Rewrite module to you site are the same default rules that are shipped with Dnn.
Default Rules
Pattern Replacement
.*/TabId/(\d+)(.*)/Logoff.aspx ~/Admin/Security/Logoff.aspx?tabid=$1
.*/TabId/(\d+)(.*)/rss.aspx ~/rss.aspx?TabId=$1
.*/TabId/(\d+)(.*) ~/Default.aspx?TabId=$1
Portal Rules
Selecting the Portal Rules option will display all the current rule sections in the list for the current Portal.
Selecting a Rule Section from in the list allows you to view, edit or delete new rules in the Individual Rules Grid
Global Rules
Selecting the Global Rules option will display all the current rule sections for rules that apply to all Portals.
The Global Rules are only available if you are logged in a host account.
Individual Rules
The Individual Rules grid allows you to enter, edit or delete rules for the currently selected rules section.
The Pattern is based upon the Rule Engine that it is Built upon. For example the Default Rule Engine (BigByteTechnologies.DNN.Modules.DnnRewrite.DnnRules) is based upon Regular Expressions and will accept regular expressions in the Pattern and Replacement fields of the grid [Pattern: .*/TabId/(\d+)(.*)][Replacement: ~/Default.aspx?TabId=$1]. The Built in Simple Rule Engine accepts only simple rules such as [Pattern: ~/Home.aspx][Replacement: ~/Default.aspx?tabid=36]
Adding a new Engine
To add a new engine to Dnn you Just click on "Add New Rule Section"
Rule Engines are load via reflection
Assembly Name is the name of the Assembly that the Rule Engine resides in.
Section Name is the name that is given to the rule set that you are creating and displayed in main list.
Namespace: is the namespace that the Rules Engine Rules Engine exist in.
ClassName is the Class of the Rule Engine that inherits the BigByteTechnologies.Portal.HttpModules.RuleBase
Drop Down List Name This is the name of the Item in the Drop down list. Item is only added if it does not already exist. Leave blank when adding a new item if you do not want it added to the list. ( This option is only Available to Host Users )
Make This Rule Section Global Checking this box causes the current Rule Set to become Global ( Effects all Portals ) ( This option is only Available to Host Users )
Optional Add From List
This optional allow you to quickly add a new Rule Section to you site by choosing the item from the list and clicking the fill from list option.
If you add a new Rule Engine to the list that is not currently in the list and Give it a name in the Drop Down List Name box then the new rule engine will automatically be added to the drop down list. ( note: Deleting an item from the list and Adding a new item to the list is only possible if you are logged on in a host account )
Known Limitations
Currently the Portal is looked up from the Domain Name of the Url as the HttpModule is invoked before the Portal loads. The Rewrite Engine is working with altered url's ( Friendly Url's ) so getting the PortalID from the PortalSettings just is not available at the time the Url Rewrite takes place. The only Method I could see to Get the PortalID was to look it up based on the Current Domain Name. If the Portal exist in a sub domain such as www.myweb.com/myportal then the Rewrite Engine will only look for a Portal based upon www.myweb.com All Global Rewrites will work for any Portal.

 


      

Copyright 2002-2005 BigByte Technologies   Terms Of Use  Privacy Statement