Sign In  |  Register
 
 DotNetNuke Powered!
DotNetNuke Support Forums

Using SiteUrls.config to clean-up Child PortalAlias on querystring

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:3196



02/12/2007 9:14 AM  

Tired of having that ugly qureystring for the home page of your child portals?  DotNetNuke child portals have their own folder under the main website so they can be referenced as a sub-folder, or "child" of the main portal.

To make this work with the rest of the portals, there is code in the default.aspx page that creates an alias parameter that looks something like this: 

alias=www.myhost.com/myportal

This child default page then redirects to the main default.aspx page with that querystring variable, so you end up getting a Url that repeats the hostdomain something like this:

http://www.myhost.com/default.aspx?alias=www.myhost.com/myportal

With the SiteUrls.config file you can have DNN rewrite this Url so that the result looks like you browsed to the child folder without any querystring variable at all.

First, figure out what the tabid is for the home page for the child portal, on mine it was tabid=508, then add a rule to SiteUrls.config like this:

  
LookFor >>    .*/child1/default.aspx
SendTo   >>     ~/Default.aspx?TabId=508
  

Where child1 is the name of your child portal.

You have to leave the child folder and the default page there, because IIS needs to find that before it will call up the web app, otherwise you'll get a 404 page not found.

This keeps your Url nice and clean and you even save the redirect.

You could also make a rule like this and get the same result without having to know the tabid:

  
LookFor >>   .*/child1/default.aspx
SendTo   >>   ~/Default.aspx?alias=www.snapsis.com/child1
  

This is a nice way to clean up the Url for a few child portals, but I wouldn't recommend running it on too many, because every rule that you add to the SiteUrls.config file adds to the overhead of every request no matter what portal you are accessing.

A more efficent way, although not quite as elegant is to just change the child's default.aspx page code so that it redirects directly to the tabid or portalid of the child portal as mentioned in this ASP.Net forums thread.

greenflash
Posts:45



02/20/2007 9:14 AM  
John thanks for the useful tip, i finally handled creating child portal on godaddy root with your instructions. Thank you very much sir.

DotNetNuke Türkçe
John Mitchell
Posts:3196



02/20/2007 9:36 AM  
Excellent, glad I could help.

In case anyone else needs to do this, here are the instructions for creating a Child Portal on GoDaddy since they do not allow write permissions to the root folder for DNN.

1. Create a subfolder using the child portal name with the GoDaddy hosting control panel.

2. Create the portal in DNN as a parent portal (creating a parent does not require DNN to create a physical folder).

3. After it is created, go in and change the PortalAlias for that portal so it maps it as the subfolder.

Note: Having a portal alias in the form of mysite.com/childfolder is really the only thing that makes it a "child" portal.

4. Then you will need to copy the subhost.aspx file from the /portals/_default folder into your child folder and rename it to default.aspx
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 clean-up Child PortalAlias on querystring



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