Sign In  |  Register
 
 DotNetNuke Powered!
DotNetNuke Support Forums

using SiteUrls.config to make Urls Human Friendly

Rate this topic:

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
Posts:3380



02/12/2007 9: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
Posts:102



02/14/2007 9:34 AM  
But that does not change the actual URL in the solpart menu...for that you need Friendly URLs


DotNetNuke Platinum Benefactor
Mariette Knap - www.smallbizserver.net
John Mitchell
Posts:3380



02/14/2007 9: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
Posts:102



02/14/2007 9: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.



DotNetNuke Platinum Benefactor
Mariette Knap - www.smallbizserver.net
SplatMan_DK
Posts:81



02/25/2007 5: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!

:-)

brgds

- Jesper
rskipper
Posts:2



09/02/2008 6: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
Posts:3380



09/02/2008 6:22 PM  

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

301 redirect fow www host

rskipper
Posts:2



09/02/2008 7: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
Posts:3380



09/02/2008 8: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.

Forums >DotNetNuke Support >Tips-And-Tricks > using SiteUrls.config to make Urls Human Friendly



ActiveForums 3.7
Visit our Store for great DotNetNuke Modules and Skins
DNNMasters Sitemap/Google Sitemap 3.0

Item codeSM3-01
Price$29.00
Product Information 
DotNetNuke CSS NavMenu 3.3 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
Snapsis PageBlaster 3.3.2 for DotNetNuke - Professional Edition

AuthorJohn Mitchell
Base Price$79.00
Product Information 
XDAkuna (Web 2.0 CSS XHTML Skin)

Item codeXDAkuna
AuthorNina Meiers
Price$49.00
Product Information