iFinity Logo
iFinity Friendly Url Provider Module

All Help Topics

How to install the iFinity DNN Friendly Url Provider

This version is for DotNetNuke Installations of 4.6 and higher, including DNN 5.0 and higheer.  Do NOT install this version on earlier version than 4.6 - it is only compatible with 4.6+ versions. 

Another, older, version is available for version 4.0 through 4.5 - however, active support for the 4.5 version has been stopped.

Note : DNN 5.0 requires a minimum version of 5.0.0 of the Friendly Url Provider.

Step 1: Download the code from the Friendly Url Provider product page.

Step 2: Copy the iFinity.FriendlyUrlProvider.dll in to the /bin directory.

Step 3: Backup your existing web.config

Step 4: Replace this entry:

<add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules.UrlRewrite"/>

with this entry:

<add name="UrlRewrite" type="iFinity.DNN.Modules.FriendlyUrl.UrlRewriteModule, iFinity.FriendlyUrlProvider"/>

Step 5:   Add this entry to the  existing "friendlyUrl" provider section:

<add name="iFinity.FriendlyUrl" type="iFinity.DNN.Modules.FriendlyUrl.DNNFriendlyUrlProvider, iFinity.FriendlyUrlProvider" includePageName="true" regexMatch="[^\+a-zA-Z0-9 _-]" urlFormat="HumanFriendly" redirectUnfriendly="true" doNotRedirect="SearchResults;" checkForDupUrls="true" forceLowerCase="false" redirectWrongCase="false" replaceSpaceWith="_" logCacheMessages="false"/>

This set of options will change an 'old' DNN friendly Url like this:
mysite.com/MyTestPage/tabId/65/MyParam/MyValue/default.aspx
to this:
mysite.com/My_Test_Page/MyParam/MyValue.aspx

This set of options is a good starting point for most websites.

Step 6: Change the entry for <friendlyUrl defaultProvider="DNNFriendlyUrl"> to <friendlyUrl defaultProvider="iFinity.FriendlyUrl">

Step 7: Try it out! Note that you may have to restart your application to get the Friendly Url provider working properly.  Also note you must have your 'Friendly Urls' option in the Host Settings page switched On.

Want More Features?

The Url Master module is the premium offering from ifinity.com.au.  Here's what you get:

Download a free trial and try it out : http://www.ifinity.com.au/Products/Url_Master_DNN_SEO_Urls/

Changing Options to use Different Features

The FriendlyUrlProvider is packed with features to tune the way your website works.  This is useful to tailor the Url behaviour to particular modules or requirements with your website.  You do not need to change anything if your website is working OK, but if you'd like to tweak it, try any of the following changes.  Either modify the existing attribute in the 'FriendlyUrl' config entry, or add the attribute in.

Complete list of web.config options

Troubleshooting Problems

The most useful tool you can use for determining errors is Microsoft Fiddler.  This is a free Http traffic monitoring tool, and will show all the web traffic going from your computer.  You can download it at www.fiddlertool.com

Install your Fiddler tool and work out how to monitor traffic from your browser to your website.  Fiddler generally only works with IE, and it won't work if you try and request http://localhost requests.  Instead, set up your website at http://machinename where machinename is the name of your web server / development PC.  Note that you need to enter the machinename/websitename into the portal alias tables in your DNN install.

With Fiddler you can detect 404,500,301 and 302 status return codes for different requests.  You do this by switching the tracing on (F12) and then requesting the page/site with a problem.  You will be able to see the results in fiddler, and by dragging/dropping the request with the error on to the 'Request' tab, you can re-submit that request without having to reload your entire web page.

Once you have worked out how to trace requests and responses, you can add this value to the end of a request : ?_fpdebug=true OR you can add a Http request parameter of _fpdebug:true.  If you do this (and provided the 'allowDebug' setting is omitted or false) you will get a set of debug information in the response headers.  You can see the response headers by clicking in Fiddler on the 'Inspectors' tab, then on the 'Headers' tab in the lower right 'Response Headers' section.

Here's an example of a debug response header:

X-FriendlyUrlProvider-Debug: http://computername/dnn500/newpage.aspx, http://computername/dnn500/New_Page.aspx, Default.aspx?TabId=79, Redirect301, 5.0.0.0

This string shows a number of comma-delimited elements.  Here's what they mean, in order:

  1. X-FriendlyUrlProvider-Debug : response header name
  2. http://computername/dnn500/newpage.aspx : originally requested Url
  3. http://computername/dnn500/New_Page.aspx : redirect destination, if supplied (will be blank if the request didn't result in a redirect)
  4. Default.aspx?Tabid=79 : rewrite path.  This is what the Url is rewritten to, so that the rest of the DNN framework see this as the Url and can request querystring parameters.
  5. Redirect301 : resulting action.  This is an internal action value which the system uses to determine the logic path of the request.  Other values are 'Continue' (means request handled ok, and should continue); Redirect302 : do a 302 redirect to the redirect path; Output404 : the request did not match a physical file on the server, and didn't match an expected DNN tab name, so output a 404 error.
  6. 5.0.0.0 : the current version of the Friendy Url Provider that handled the request

If you cannot figure out the problem, go onto the Friendly Url Provider support forum at http://www.ifinity.com.au/Products/Support_Forums/.   You'll get the problem solved much quicker if you can supply the fiddler trace or status of a particular request.  Also useful is any events from the DNN Event log, and the copy of your DNNFriendlyUrl provider web.config entry. 

In the response headers, if there is a redirect, you'll also see a value like this:

    X-Redirect-Reason: Spaces Replaced Requested

The X-Redirect-Reason header shows the reason a redirect was done.  This may provide further insight into why a redirect occured.

Typical Errors Encountered

Generally, problems with your website generally fall into one of the following categories:

  1. 404 Errors (page not found).  If you're getting a 404 error, first check to see if you entered the 'UrlRewrite' entry in the HttpModule section.  Remember if you're using IIS7, it will need to be in the <system.webserver> and if you're using IIS6, in the <system.web> section.  If this is OK, then check to make sure you have the Url correct, and if the problems affect all pages, or just a single page.   404 errors often occur on things like images and stylesheets, which show up as broken links and incorrect formatting of the page.
  2. Unwanted Redirects.  Unwanted redirects often show up looking like 404 errors (things like broken image links in pages, etc).  This usually happens when the provider thinks it has found an 'unfriendly' url, and tries to forward the request to a more friendly version.  Use Fiddler to find the redirected request, then work out why it is redirecting.  Some modules use requests to custom files with 'tabId' in the string : often the FriendlyUrlProvider intercepts this and tries to find the correct matching tab.  In these cases you need to exclude this particular path in the 'doNotRedirectRegex' setting.
  3. Incorrect rewrites.  You may see something where you request a particular page, but it shows the wrong page.  This can also show the parent page of a page instead of the 'child' page.  This normally happens because a match is found on the parent page, but not on the child page.  Normally you would correct this type of problem by working out what the Url for the child page should be, and figuring out why it's not matching - for example, you have 'replace spaces' enabled but are requesting the child page with the wrong url.

Relationship between page extension and parameter handling

The following table shows the different Url results that arise from using the various values of pageExtensionUsage and parameterHandling.

pageExtensionUsage=�never�*

pageExtensionUsage=�always�

/Enquiries/

/Enquiries.aspx

pageExtensionUsage=�never� *

parameterHandling=�ordered�

pageExtensionUsage=�always�

parameterHandling=�ordered�

/TagList/Tag/Valuers/

/TagList/Tag/Valuers.aspx

pageExtensionUsage=�never� *

parameterHandling=�firstparmlast�

pageExtensionUsage=�always�

parameterHandling=�firstparmlast�

/TagList/Valuers/Tag/

/TagList/Valuers/Tag.aspx

pageExtensionUsage=�pageonly� *

pageExtensionUsage=�always�

pageExtension=�.page� **

/Enquiries.aspx

/Enquiries.page

pageExtensionUsage=�pageonly�

parameterHandling=�ordered�

pageExtensionUsage=�always�

pageExtension=�.page� **

parameterHandling=�ordered�

/TagList/Tag/Valuers/

/TagList/Tag/Valuers.page

pageExtensionUsage=�pageonly� *

parameterHandling=�firstparmlast�

pageExtensionUsage=�always�

pageExtension=�.page� **

parameterHandling=�firstparmlast�

/TagList/Valuers/Tag/

/TagList/Valuers/Tag.page

Using the FriendlyUrlProvider to give cleaner, no-extension Url's

This Friendly Url provider has the ability to provide even better Url's if you have the ability to change the default Asp.Net ISAPI mappings on your website. Most shared hosting companies will not allow this, but if you are hosting your website yourself, it is very easy to do.

This will transform a url like this: mysite.com/MyTestPage/tabId/65/MyParam/MyValue/default.aspx
to this:
mysite.com/My_Test_Page/MyParam/MyValue/

There are two things to do to obtain this behaviour: (1) Modify the web.config settings and (2) Change the IIS settings.

(1) Modify the web.config to support extension-less Url's

Change the DNNFriendlyUrl section in your web.config file so that the pageExtension value looks like this: pageExtensionUsage=�never�

(2) Check to make sure correct files are excluded from processing.

The 'ignoreFileTypesRegex' value filters out files which shouldn't be processed by the Url Rewriter.  Scan through this list of extensions and make sure common values like .ico, .jpg, .gif etc are excluded, unless you have a module which performs some processing (examples are modules that show per-user images on profile pages).  In these cases you may need to construct a conditional regex statement which allows files of a certain type through the Url Rewriter, and blocks others.

(3) Changing IIS Settings to map all requests through the aspnet isapi dll

Warning: This may destabilise your website. Always check this on a test version first, and understand what you are doing! Before you start any changes, always know how to 'get back' to how your site was before starting. These instructions will vary between IIS 5.0, IIS 6.0, IIS 7.0 and the Workstation and Server versions of 2000/XP/2003/Vista/2008

IIS 5.0 - Windows XP

IIS 6.0 - Windows 2003 Server

IIS 7.0 - Windows 2008 Server / Vista

Then thoroughly test all website functions. And you're done!