Sign In  |  Register
 
 
DotNetNuke Support Forums
using SiteUrls.config to make Urls Human Friendly
Last Post 02 Sep 2008 08:17 PM by John Mitchell. 8 Replies.
Printer Friendly
Sort:
PrevPrevNextNext
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4384
Avatar

--
12 Feb 2007 09:44 AM  

If you want to, you can create a rule in your SiteUrls.config file that will allow your pages to be accessed with a specific Url that you create.

It is really simple, you just need to first find the actual tabid of the page that you want to create a nice Url for, then change SiteUrls.config to add a new rewriter rule. In the latest versions of DNN you can make this change in Host Settings.

So, if you have a tab that hosts the forums for support, you might want to have people access it like this:

http://www.snapsis.com/Support.aspx , then I would create the rule as follows:

LookFor >>   .*/support.aspx[\?]?(.*)?

SendTo  >>    ~/default.aspx?tabid=601&$1

The codes at the end of the LookFor rule capture any Querystring that is on the Url and transfer those to the Url it sends to.

Mariette
Basic Member
Basic Member
Send Private Message
Posts:100
Avatar

--
14 Feb 2007 09:34 AM  
But that does not change the actual URL in the solpart menu...for that you need Friendly URLs
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4384
Avatar

--
14 Feb 2007 09:43 AM  

Well actually SiteUrls.config is the config file for DNN's FriendlyUrls, but I know what you mean.

Href Exchanger or PageBlaster can change the links in the output of your page so that they match with the FriendlyUrls used to access your pages.

HrefExchanger does it automatically by using the Page Name and PageBlaster lets you specify it explicitly.

Mariette
Basic Member
Basic Member
Send Private Message
Posts:100
Avatar

--
14 Feb 2007 09:59 AM  

I still think using any tool to automatically changes the URL for a tab includes some risk. Once that URL is cached or crawled by Google and you have to change it for some reason you will see tons of errors in your logs. I had that in the past when I used some of those tools on a site and had to write some code to send a 'permanently moved' to Google to get the logs clean.

The hype that is going on about friendly url's will damage your site more then you want if you change something. That is the reason why I stick with the default TabId url in Dotnetnuke.

SplatMan_DK
New Member
New Member
Send Private Message
Posts:81
Avatar

--
25 Feb 2007 05:58 PM  
On the other hand, some of us find it quite usefull.

I recently converted my site from old-style handwritten HTML/PHP files to a 4.4.1 DotNetNuke portal. I am extremely satisfied with the result (specially after I got reasonable performance by using PageBlaster) but I also had *A LOT* of broken links out there on the internet. Cached in servers, written in forums, and stored in peoples browser bookmarks.

I have "abused" the friendly URL functionality to ensure that all my old page names still work, and point to new pages in my DNN portal with the appropriate content.

Crude? Perhaps. But also quick, easy, and efficient!

:-)
rskipper
New Member
New Member
Send Private Message
Posts:2

--
02 Sep 2008 06:06 PM  

Using the SiteUrls.config, is there any way to create a lookfor/sendto pair that will re-write a request such as domain.com/* to www.domain.com/*  adding the www ?

John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4384
Avatar

--
02 Sep 2008 06:22 PM  

SiteUrls.config can't do a 301 redirect, but here is a way to do it:

301 redirect fow www host

rskipper
New Member
New Member
Send Private Message
Posts:2

--
02 Sep 2008 07:22 PM  

I greatly appreciate the assitance, however when I copy the code into my ascx skin - the skin won't load.
Is there anything else that I need to do?
thank you again,
Skip

John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4384
Avatar

--
02 Sep 2008 08:17 PM  
The code may have been a little messed up after copy and pasting.
If you want to attach your skin file here (after zipping it, or renaming to .txt), I'll take a look at it.

Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.


Active Forums 4.1
Visit our Store for great DotNetNuke Modules and Skins
DotNetNuke CSS Menu 3.4.6 (single use)

Item codeCSSNM33SU
AuthorJohn Mitchell
Base Price$39.00
Product Information 
DotNetNuke CSS NavMenu 3.4.6 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
DotNetNuke Performance Caching & Compression - PageBlaster 3.4.5 - Professional Edition

AuthorJohn Mitchell
Base Price$59.00
Product Information