سؤال

I am designing a website using Dotnetnuke latest version 7.1. I wanted make my website search engine friendly. I got options to add meta keywords, description. Another thing i wanted on my site is canonical tags for all the pages in the site. I stumbled upon many forums which gave an idea about manually adding canonical tags in Page header section for each page but these tutorials were written based on DNN 4.x and 5.x.

Since DNN7 pages doesnt have page extension like .aspx as previous versions did. Is their any possibility to automatically add canonical tags in DNN 7.x like any module or any technique add canonical for the same.

Thanka in advance,

هل كانت مفيدة؟

المحلول

You can do this with the default settings for the base Page URL's.

Go to "Admin" -> "Site Settings" while logged in as a Host user. Under the Portal Aliases section you can set "canonical" as the preferred option.

نصائح أخرى

You only need canonical tags if users will be linking to your pages using different URLs. For example, here on Stack Overflow, all you really need to reach this question is the following address:

http://stackoverflow.com/questions/19516100/

Anything after the trailing / is optional. Because the title may change over time, and because Stack Overflow allows linking directly to individual answers and only shows the shortened version of the url in certain circumstances, several different links to this page may exist in the wild. Stack Overflow needs the canonical tag so that if Google crawls this page based on a referral from one of those links, Google properly attributes the page to the correct location.

Prior to DNN7.1, it was common on a DNN site to end up with links both with and without the .aspx extension, and so the Canonical tag was needed and helpful on every page. Now, you have correctly noted that DNN7.1 only ever presents the page name without the .aspx extension. Therefore, the only places where you need a canonical link are those cases where you've done a 301 redirect within your own site, and for those cases it's easy enough to add the canonical tag using the old method.

That didn't work for me on https. I had tu force the LINK rel canonical tag on the file SiteAnalytics.config into both paragraphs:

<![CDATA[     
    <script>
        ... google analytics script
    </script>
    <LINK href="https://yourdomain.com/" rel="canonical" />
]]>

and

<![CDATA[     
    <noscript>
        ... google analytics script
    </noscript>
    <LINK href="https://yourdomain.com/" rel="canonical" />
]]>

Hope that helps alienated folks like me.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top