Having been concentrating on projects as of late, I have gotten away from doing timely updates for this blog as well as getting this series of tips & tricks updated regularly.
Continuing from the last one we find ourselves in the Friendly URL Settings section of the Host Settings. This section allows us to define how the Friendly URL's will work within the framework and where to redirect them to be acted upon.
In a new installation of DotNetNuke we will have 5 items defined in the site to be acted upon. Under the title for Friendly URL Settings we have are asked the question "Use Friendly Urls?" with a checkbox. If this checkbox is checked then this tells DNN to use the following types of urls: http://localhost/dnn482/home/tabid/36/default.aspx this looks better than http://localhost/dnn482/default.aspx?tabid=36. Plus has the added benefit that search engines are much more appreciative of the first one and allows your site to be indexed better.
Under the checkbox 5 items are listed with edit and delete buttons and an Add New Rule link under them. These are the current rules that have been defined for use within your site. Lets take a look at them.
- Match: .*DesktopDefault.aspx(.*) - Replace with: ~/Default.aspx$1
Originally the older systems use DesktopDefault.aspx as the main start page so this allows an old search results or favorites to be redirected to the new Default.aspx page. - Match: .*EditModule.aspx(.*) - Replace with: ~/Default.aspx$1
Same basic thing old sites used an EditModule.aspx page to allow the editing of a module this has been changed to allow redirection through the default.aspx page. - Match: .*/TabId/(\d+)(.*)/Logoff.aspx - Replace with: ~/Admin/Security/Logoff.aspx?tabid=$1
This redirects any logoff requests through the admin logoff.aspx page. - Match: .*/TabId/(\d+)(.*)/rss.aspx - Replace with: ~/rss.aspx?TabId=$1
This redirects any rss feed requests through the main rss.aspx page with the tabid attached. - Match: [^?]*/TabId/(\d+)(.*) - Replace with: ~/Default.aspx?TabId=$1
This redirects the request back through the main default.aspx page.
These five are the most common ones that anyone will ever need but gives us the ability to add new types of extensions or to re-map old links to new pages within the site if this was replacing a static html site. As you can see from the above the friendly urls are created using regular expressions.
This feature when it was introduced greatly expanded the capabilities of DNN as well as improving the adoption by web developers. Previously to this feature being added search engine rankings were not very good for sites using this framework because the search engines didn't like the querystring being used with the pages.
Hope this article helps with the understanding of Friendly Url Settings within the Host Settings of your DotNetNuke site.
Technorati Tags:
DotNetNuke,
ASP.NET del.icio.us Tags:
DotNetNuke,
ASP.NET