iFinity Blogs 

Using the 'Permanent Redirect' DotNetNuke Page Option

Feb 24

Written by:
Tuesday, February 24, 2009 11:22 PM  RssIcon

When DotNetNuke 4.9.2 and 5.0.1 landed, they contained a new option on the Page Settings screen : 'Permanent Redirect'

dnn-permanent-redirect-page-option

This option allows you to define a new destination for the page in question.  To use it, you tick the permanent redirect option, and select a destination Url by defining a Url in the 'Link Url' field. 

Once you have saved this option, any request for that page will return a 301 redirect http status code, and provide the new Url as the destination.  If you choose a page as the link, the 301 redirect will go to the current Url for that page.  If you choose a url, the redirect will be sent to that Url, as is.  For this reason, you need to include the full reference to the url, including the http:// prefix.

If you're not familiar with 301 Redirects, I've done a blog post covering their use : Understanding 301 Redirects

Note that you cannot redirect to a file using the drop down list, although you can redirect to a file by simply entering the full path of the file in the Url field.

A quick note to remember.  Once you've saved the redirect, you can't use the original Url anymore.  If you click on the page in the menu (assuming it's still visible in the menu) then you'll get redirected to the destination.  So if you want to go back and uncheck the permanent redirect option, you'll need to go into the Admin->Pages page and select the 'settings' icon for the redirected page.

What's the Permanent Redirect option for?

I've talked extensively about 301 redirects in the past : they are very useful when performing Search Engine Optimisation on your site.  This new DNN option allows us to move content from one page to another, and preserve the incoming link value of the 'old' page.  Used properly, it will also let you move pages from one site to a completely new site. For example, if you decided to split your site in half and move half to a new domain, you could achieve this by setting up redirects for all the migrated pages.  It's certainly a good tool to have.

Problems with the Permanent Redirect Option

There's one significant shortcoming with the Permanent Redirect option.  If you have a module which uses a query string on the 'old' page, any redirect to the new page does not take the query string information with it.  I'll give you an example:

Let's imagine I have had my blog on a page called 'weblog' for a while.  I've done about 100 posts on it over time, and I have some good rankings for some of the pages.  But the name 'weblog', I decide, is no longer in.  Let's assume I want to change the page name to 'blog'.  Now I know that if I change the page name in DNN, the new Urls will just show up under 'blog' instead of 'weblog'.  No problem.  However, all the links on other people's websites point to the 'weblog' page, and they look something like this : /weblog/tabid/45/entryid/1/my-interesting-post.aspx.  

So I decide to 301 redirect all the pages to my new page : /blog/tabid/46/default.aspx.    I setup the permanent redirection option, try out the old page : everything is fine.  I enter /weblog/tabid/45/default.aspx into my browser and are successfully redirected to /blog/tabid/46/default.aspx.  Works great! 

I then try to look at one of my blog posts, so I enter /weblog/tabid/45/entryid/1/my-interesting-post.aspx - only to find I get redirected to /blog/tabid/46/default.aspx.  

And there is the problem : any querystring information is not passed through to the destination Url. If you have good page ranks for individual module urls (such as blog posts or forum threads) then the rankings for those pages will be lost and transferred to the 'base' page.

Permanent Redirect and iFinity Modules

The first thing people started asking me when this came out was : how does this affect the iFinity Friendly Url Provider and iFinity Url Master modules?   The simple answer is : great! 

Because of this new flag, the Core team have inadvertently added a feature to my Friendly Url Provider module that was previously only in the Url Master module : the ability to do custom 301 redirects.  Note that with the iFinity Friendly Url Provider, when you do the 301 redirect, you do carry across the querystring data, so you can safely use it with modules like the Blog or Forums modules which extensively use querystring information.  But the restriction remains in that you can only 301 redirect from an existing DNN page to somewhere else, you can't migrate over old sites by redirecting from any old Url.

Of course the Url Master module could already perform custom 301 redirects, so it's nothing new.  The core change does provide a distinct advantage though : something that couldn't be done before.  You can now redirect to an completely external Url or file.  Previously with the Url Master module, you could only redirect to other DNN Pages.   The DNN Permanent Redirect allows you to redirect to an defined url, but you can only redirect from a DNN page url.  The Url Master module has always had it the other way around : you could always redirect from any external url (as long as the domain name matched) but you could only redirect to a DNN page.  With the release of 4.9.2/5.0.1 and Url Master 1.13.8, you can now do both.

I can see some interesting scenarios with this : I occasionally get requests to 301 redirect from specific pages to other websites (such as to a domain specific for a country or language).   This should now be achievable with some creative use of existing DNN pages and destination urls.

Other changes I've made for the 1.13.8 release include showing on the Page Urls screen the redirect to value, if the selected page has the 'Permanent Redirect' option enabled.   I experimented with ways to incorporate the Url into the list of urls for each page, unfortunately because it works in the reverse way, that couldn't be achieved simply.  I may figure out a way in a future release : for now it is just shown under the page url.

So with this change, where does this leave the Url Master module?

Some people have asked me if using the Url Master module is necessary anymore, seeing as redirects can be done directly in the Page Settings of DNN.   The answer is 'Yes, of course!'  The addition of a simple 301 redirect system for DNN pages actually makes the module more valuable, because:

  • It expands the simple 301 redirect of the Core DNN functionality to include the transfer of any querystring information from the original url to the destination url.  This means you can redirect pages used with modules like the Blog module.
  • It's still the best way to migrate from an old site to a new site; you can redirect from any arbitrary Url (including Urls for different extensions like .htm and .php) to destination DotNetNuke pages.  The DNN Core Redirect only allows you to go from a DNN page to another DNN page, or another Url

You still get all the other great features of the module, including :

  • the ability to change Urls for pages
  • automatic 301 redirects of the 'old' DNN urls
  • 301 redirection to a specified subdomain (ie, always use 'www')
  • replacement of spaces with hyphens in urls for page names, plus automatic 301 redirects of the Url with no spaces in it
  • replacement of diacritic characters with ascii equivalents, plus automatic 301 redirects of the diacritic character version of the Url
  • quick and easy installation and configuration
  • ability to change or remove the .aspx extension
  • forcing lower case for urls;
  • and more : please read the product information page for the full list.

In fact, the new 'Permanent Redirect' option actually enhances the module, as it does for any DNN Installation, no matter what Friendly Url solution you're using.

New Versions to Download

The new version of the iFinity Url Master Module is available from the Url Master product page

In order to run with DNN 4.9.2, you will need at least version 1.13.08 of the Url Master module.

The new version of the iFinity Friendly Url Provider is available from the Friendly Url Provider product page

Tags:
Categories:
Location: Blogs Parent Separator Crafty Code

24 comment(s) so far...


Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

Good article. One thing that would be interesting is to see how the Request Filter's 301 redirect capability matches up.

By Joe Brinkman on   Tuesday, February 24, 2009 11:52 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

Great post! What does this do for future development of the URL Master Module? Do you foresee it being added to the core?

By Scott Allender on   Tuesday, February 24, 2009 11:53 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

Another detailed look at 301 redirects within DNN ... well done!

By Tom Kraak on   Wednesday, February 25, 2009 4:49 AM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

@Joe that's a good point, I'll look into it. I haven't revisited the request filter for a few versions.

@Scott : no, I don't see the Url Master functionality being added into the core. It doesn't really affect the future development of the module because the core redirects cover such a small subset of what redirect (and Url) control you really need if you want to tune your site for SEO purposes.

By Bruce Chapman on   Wednesday, February 25, 2009 7:45 AM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

"In order to run with DNN 4.9.2, you will need at least version 1.13.08 of the Url Master module."

Hmm - I was unaware that a URL Master update was needed for DNN 4.9.2 - I upgraded last week and have noticed no errors but someone else mentioned that UM did not work on 4.9.2 (I am awaiting clarification from them!). I am running 1.13.3 so I will update to the latest now. Can you elaborate on the behavior that will not work?

I can see some errors in the log:
Method: iFinity.DNN.Modules.UrlMaster.UrlRewriteModule.SecurityCheck
StackTrace:
Message: System.Exception: Unhandled Error: ---> System.Web.HttpException: Not Found at iFinity.DNN.Modules.UrlMaster.UrlRewriteModule.SecurityCheck(HttpApplication app) at iFinity.DNN.Modules.UrlMaster.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace ---

but it seems to work fine in the UI?

By Rodney Joyce on   Tuesday, March 03, 2009 9:36 AM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

@Rodney

You will only discover the 4.9.2 incompatibility if you either (a) do a fresh install or (b) try to add a new portal to your existing install. Otherwise 4.9.2 will work fine with an earlier (than 1.13.08) version of Url Master, but you won't get the permanent redirect functionality working until you upgrade to 1.13.08.

Not sure what the securitycheck exception is : it could be an app problem, or it could be a failure of the security check code : ie someone sending bad requests to your server.

By Bruce Chapman on   Tuesday, March 03, 2009 9:41 AM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

Ok, I have updated anyway, I'll keep an eye out for more exceptions in the log...

By Smart-Thinker on   Tuesday, March 03, 2009 9:46 AM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

I am trying to use the permanent redirect option for a page but when i type the url into my browser it doesn't redirect - i get a 200 OK response instead of a 301. Could this be a server configuration problem or am I not understanding how it is supposed to work?

By Dean on   Tuesday, June 23, 2009 2:34 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

@dean : it's not likely to be a server configuration problem. I would go back through and double check all of your steps, making sure you have the correct destination url etc, and check with a tool like Fiddler.

By Bruce Chapman on   Tuesday, June 23, 2009 2:38 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

Sorry about that double post, i accidently refreshed the page and posted a 2nd time. I've created a page MyDomain.com/agents and I've selected a link type of URL and typed in agents.MyDomain.com and then checked the box to permanently redirect. Is there anything wrong with those steps?

By Dean on   Tuesday, June 23, 2009 2:44 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

@dean : it's hard to say why that might not work : it sounds right but there might be other factors involved. If you're using the Url Master software as well, please open up a support thread in the support forums and I'll work through it with you.

By Bruce Chapman on   Tuesday, June 23, 2009 2:48 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

How do you perform a URL redirect on existing "HTML" pages from a site which did not use DNN to a new site which now uses DNN using Ultra reWrite.

By Supersum on   Sunday, November 01, 2009 2:21 AM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

@supersum I have no idea what Ultra Rewrite is, but see my blog post www.ifinity.com.au/Blog/Technical_Blog/EntryId/66/How-To-301-Redirect-htm-or-html-pages-to-DotNetNuke-aspx-pages for more information.

By Bruce Chapman on   Sunday, November 01, 2009 9:05 AM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

Hi:

I accidently redirected the Login page to an invalid page, Now I cannot login even as host. Could you please help.

Thanks,
GC

By Gyan Chandra on   Thursday, September 30, 2010 2:31 AM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

@gyan you will have to undo the redirect by directly updating the database. I recommend posting your question at the dotnetnuke.com forums.

By Bruce Chapman on   Thursday, September 30, 2010 8:43 AM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

I have a question about redirecting pages.

How can i redirect to an external resources and make the page open on a new window

By patson on   Thursday, April 28, 2011 11:13 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

@patson - you can't. A server based redirect only works in the current session. You'd have to try and come up with possibly a javascript redirect or something like that. But I would expect most popup blockers to prevent an action like that from occurring.

By Bruce Chapman on   Friday, April 29, 2011 8:39 AM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

Hi,


We will be migrating our site based on classic asp to DNN. The site architecture is being rebuild so the url structure will change also. We would like to know if there's option to do 301 redirect to the new pages if the old pages are requested. Assume the domain will be same.

For example

www.somesite.com/demos
would be redirected (301) to
www.somesite.com/seeit/demos

Is it possible using dotnet nuke and this module???

By Prithwiraj on   Friday, August 12, 2011 4:36 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

@Prithwiraj Yes, the Url Master module can handle those redirects. You can download a free trial from the Url Master products page

By Bruce Chapman on   Friday, August 12, 2011 4:39 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

sorry the page got submitted again.


Thanks for the prompt response. Could you please help me how to achive that? I am new to dotnetnuke and this module

By Prithwiraj on   Friday, August 12, 2011 4:48 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

You can start with this blog post : http://www.ifinity.com.au/Blog/EntryId/96/How-to-301-Redirect-asp-Urls-to-DotNetNuke-aspx-pages

Download the trial and try it out, then use the product support forums if you have any difficulties.

By Bruce Chapman on   Friday, August 12, 2011 4:50 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

Also I have downloaded a copy of free trial and installed in my local DNN installation

By Prithwiraj on   Friday, August 12, 2011 4:50 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

Bruce,

Thanks again for the reply. I have already gone through the blog entryand trying out custom redirect
For example I am giving 301 redirect to the page
localhost:8088/AboutUs/tabid/60/Default.aspx
from the url
localhost:8088/demos


but setting this up gives

HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.


Can you help me out here please. ?


Also I have done all the steps pointed out in the blog

By Prithwiraj on   Friday, August 12, 2011 5:06 PM
Gravatar

Re: Using the 'Permanent Redirect' DotNetNuke Page Option

@Prithwiraj please create a new thread in the Url Master support forum for help with specific problems.. Also look at the Url Master knowledge base for help in diagnosing 404 problems.

By Bruce Chapman on   Friday, August 12, 2011 5:22 PM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
Bruce Chapman
Hi, I'm Bruce Chapman, and this is my blog. You'll find lots of information here - my thoughts about business and the internet, technical information, things I'm working on and the odd strange post or two.

 

Share this
Get more!
Subscribe to the Mailing List
Email Address:
First Name:
Last Name:
You will be sent a confirmation upon subscription

 

Follow me on Twitter
Stack Exchange
profile for Bruce Chapman at Stack Overflow, Q&A for professional and enthusiast programmers
Klout Profile