How to deactivate/modify automatic canonical url generator in liferay 7.3?

1年前 に Jamie Sammons によって更新されました。 New Member 投稿: 2 参加年月日: 24/12/31 最新の投稿

Hi,

i am using Liferay DXP 7.3 and i have automatically generated canonical urls for my site..

I have 4 locales selected for my site and i want to generate canonical urls for only 2 of them..But liferay automatically generates canonicals for all the 4 locales selected. Also liferay is not appending the language code for the alternate url generated for the default language. i have to override this behaviour also..

How can i achieve this?

i have tried using a dynamicInclude and generated custom urls programatically to top_head.jsp..

But i have to disable the automatic url generation so that only the urls from dynamicinclude appears on the html..How can i deactivate automatic canonical url generetaion in liferay?

1年前 に Jamie Sammons によって更新されました。 New Member 投稿: 1 参加年月日: 25/04/08 最新の投稿

@Akhil Raj, please to share the solution if it is founded  

1年前 に Jamie Sammons によって更新されました。 New Member 投稿: 2 参加年月日: 24/12/31 最新の投稿

I found the solution by adding a hook.

The auto Url generation cannot be deactivated. instead i have used a hook to override the service that is building this url patterns in page source.

We have to override the service

LayoutSEOLinkManagerImpl

using a hook.

deploy the hook and then we have to blacklist the original component from System settings -> Module container -> Component blacklist