Try our conversational search powered by Generative AI!

Canonical URLs - how?

Vote:
 

I want to add/control canonical URLs in my Episerver installation. When using the Simple Address information you can use a canonical URL on one page. But I have three pricelists which all contains the same content (but different left menus). The two duplicates fetches data from the original one, which I want to use as a canonical url for the other pages (the duplicates).

If I try to use the same simple address twice or three times, it brings up an error saying:

”Simple address for this page” with value ”producttype/prices” is already in use by Prices [8739].


Is there a way to do this, without programming an extension?

#59520
Jun 14, 2012 10:12
Vote:
 

I am not entirely sure what you are trying to achive here. Why would you like to have three pages with the same url?

But in any case there is no way you can specify the same canonical url for three pages. How would the CMS know what page out of the three to redirect the user to?

 

#59550
Jun 15, 2012 12:47
Vote:
 

You're using the canonical URL for specify the main page out of the three for search engines, to make sure you don't any penalties in your search ranking?

What I would probably do is see if the page I'm on is fetching data from another page, if it is then use the LinkUrl or SimpleUrl of that page and write it out in the canonical meta tag. Let me know if you need some example code.

Frederik

#59551
Jun 15, 2012 12:51
Vote:
 

Claus: The three pages don't get the same URL by using simple url. The only difference when using it is the canonical URL.


Frederik: Correct. That is exactly how I want to use this. The two duplicates do fetch the data from the original one. But is there a way to set this up directly in Episerver or do I have to access the files "manually" and add/change the code?

#59573
Jun 18, 2012 8:27
Vote:
 

Nothing built in, you'll have to add a little code yourself.

#59578
Jun 18, 2012 11:23
Vote:
 

Ah ok. Thanks for the answer :)

#59579
Jun 18, 2012 11:48
Vote:
 

Hi, 
So how do I install this function on Episerver Cms6? I don't want to do it manually, like typing the the html code. I just want to type in the address on the edit page and then it will be automatically a Canonical. Do you understand my question?

#71206
May 14, 2013 10:54
Vote:
 

As Frederik Vig writes above, EPiServer does not handle canonical URLs by default, you have to add this functionality manually in code.

It's not a big operation, but requires you to edit your aspx page and the codebehind file. Frederik has an example of this on his blog: http://www.frederikvig.com/2009/11/specify-your-preferred-external-url-in-episerver/

There is a commercial plugin that will handle canonicals, 404s and various redirects for you: http://www.mogul.com/en/web/products/seo-manager/seo-manager-for-episerver

(This is installed through EPiServer Deployment Center, so you won't have to make any code changes manually). 

 
#71210
May 14, 2013 11:41
Vote:
 

So if I show this page: http://www.frederikvig.com/2009/11/specify-your-preferred-external-url-in-episerver/, the operator will understand what do do?

#71263
May 15, 2013 10:40
Vote:
 

If by "operator" you mean the people who developed your web site, then yes they should be able to fix it.

 

#71265
May 15, 2013 10:46
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.