Making DotNetNuke Logo Link SEO Friendly!

Tuesday, May 12th, 2009 by Oracle9. Filed under DotNetNuke, SEO.

Often SEO geeks will advice you not to use the original Logo skin object due to that it will automatically append Default.aspx behind your domain name. This is very bad as it search engine may treat it as a duplicate page of your home page. Even Search Engine will not ‘punish’ you for that but your PageRank weight will definitely be dispersed into different URL like www.example.com and www.example.com/Default.aspx.

If you are using iFinity, most of the time the url problems will be solved. However, due to some server setting, the default.aspx name cannot be removed. In this case, all you need to do is to make a simple change to the DNN Logo Skin Object.

For DNN 5.1 Above, please scroll down for solution.

To do this, FTP access to /httpdocs/admin/Skins and look for Logo.ascx.vb.

Open it using notepad or other development programs like dreamweaver or visual developer and look for this line: (Should be in line 73 be default)

hypLogo.NavigateUrl = GetPortalDomainName(PortalSettings.PortalAlias.HTTPAlias, Request) & “/” & glbDefaultPage

Now all you need to do is to remove this code:

& glbDefaultPage

Save it and upload it back to the same directly. Walla! You can change your logo much easily from Portal Admin Setting while having a clean SEO friendly URL!

Unfortunately, I still haven’t figured out a simple method to remove the Home.aspx which most of the DNN users are having the same problem. If you know how to make your DNN auto generated home page url convert into your root domain name automatically , please share with us!

Update: This is the solution to remove relundant default.aspx in DotNetNuke 5.1 Logo Skin Object.

To do this, FTP access to /httpdocs/admin/Skins and look for Logo.ascx.vb.

Look for these lines: (Around line 78)

If Host.UseFriendlyUrls Then
hypLogo.NavigateUrl = FriendlyUrl(Nothing, “~/”, PortalSettings)
Else
hypLogo.NavigateUrl = “~/”
End If

Change FriendlyUrl(Nothing, “~/”, PortalSettings) to GetPortalDomainName(PortalSettings.PortalAlias.HTTPAlias, Request) & “/”

Related posts:

  1. DotNetNuke Customizing your Login – PART 3
  2. DotNetNuke Custom Error Page, 404 Page Not Found Redirection
  3. DotNetNuke Accessibility Skins
  4. How to modify DotNetNuke Login Page? The Easy Way.
  5. SEO Tips: what is Canonical link and how to use it.


Tags: ,

10 Responses to “Making DotNetNuke Logo Link SEO Friendly!”

  1. Ron says:

    Unfortunately the file in DNN 5.1.0 looks like this:

    If Host.UseFriendlyUrls Then
    hypLogo.NavigateUrl = FriendlyUrl(Nothing, “~/”, PortalSettings)
    Else
    hypLogo.NavigateUrl = “~/”
    End If

  2. George says:

    Yes, thank you for pointing this out.

    With this enhancement, it will not generate the extra ‘default.aspx’ at the end.

    However, “FriendlyUrl(Nothing, “~/”, PortalSettings)” are not working so well with other friendly url modules currently.
    Hope this will be fixed in future.

    If you’re using ifinity module to rewrite the url, you may still change the = FriendlyUrl(Nothing, “~/”, PortalSettings) to GetPortalDomainName(PortalSettings.PortalAlias.HTTPAlias, Request) & “/”
    to temporary fix the problem.

  3. Laxmi says:

    Thanks for these great information. My site has also a canonical Issue i want to redirect http://alert-ims.com to http://www.alert-ims.com. Is its possible in dotnetnuke without using IIS Server redirection.

    I also place the 301 ASP redirection code in my default page through put its not work code is given below please check is its correct or not-:

    or

    Please mail me if its possible through dotnetnuke.

    Regards
    Laxmi Narayan

  4. George says:

    If you do not have server access, the simplest way is to use ifinity Url Friendly Url Provider (Free), their URL Master is even easier to fix all bad links. If you needed a more advance solution, Snapsis PageBlaster is a good option too.

    It is possible because DotNetNuke is a framework, you could download the source code from Ventrian Url Provider if you wish to know the theory behind.

  5. David says:

    Sorry this doesn’t seem to be working for me. I don’t understand the exact code I am supposed to replace.
    Should this code:

    ‘ use site root
    If Host.UseFriendlyUrls Then
    hypLogo.NavigateUrl = FriendlyUrl(Nothing, “~/”, PortalSettings)
    Else
    hypLogo.NavigateUrl = “~/”
    End If

    Be replaced with this:
    ‘ use site root
    If Host.UseFriendlyUrls Then
    GetPortalDomainName(PortalSettings.PortalAlias.HTTPAlias, Request) & “/”
    Else
    hypLogo.NavigateUrl = “~/”
    End If

    Thanks

  6. George says:

    It should be like this:

    If Host.UseFriendlyUrls Then
    hypLogo.NavigateUrl = GetPortalDomainName(PortalSettings.PortalAlias.HTTPAlias, Request) & “/”
    Else
    hypLogo.NavigateUrl = “~/”
    End If

  7. David says:

    This doesn’t seem to be working for me.
    I get a a runtime error:
    Server Error in ‘/’ Application.

    Any ideas how to get this to work with DNN v5.1.4 – I have the following code:
    If PortalSettings.HomeTabId -1 Then
    ‘ use portal home page specified
    hypLogo.NavigateUrl = NavigateURL(PortalSettings.HomeTabId)
    Else
    ‘ use site root
    If Host.UseFriendlyUrls Then
    hypLogo.NavigateUrl = GetPortalDomainName(PortalSettings.PortalAlias.HTTPAlias, Request) & “/”
    Else
    hypLogo.NavigateUrl = “~/”
    End If
    End If

    Thanks

  8. George says:

    I’ve tested it code and it works fine.

    1. If you have no DNN FriendlyUrl enable, you need to change line 77 instead of 81.

    2. Please do not copy directly from the comment as Wordpress editor automatically covert the double quote ” ” and the &. (Don’t use curly quote)

  9. David says:

    I managed to add the code and website dsiplays corrrectly. The problem is I am still able to type in: http://www.domain.com/default.aspx and the page appears. Is there any way to fix this?

    thanks

  10. SEO Bristol says:

    Hey, great blog post. Do you only write on here or do you write on other blogs to? Would like to follow your content.

Leave a Reply