[Skip to main content](#vessel-content)

#   Two canonical URLs

##

- **[watashi](/forum/user/8585-watashi "View watashi's Profile")**
- [![watashi's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8585-watashi "View watashi's Profile") Topic Author
- [ Offline](/forum/user/8585-watashi)

Less More

- Posts: 120
- Thank you received: 1
-
-
-

13 years 2 months ago -  13 years 2 months ago [\#124590](#124590) by [watashi](/forum/user/8585-watashi "View watashi's Profile")  *[Two canonical URLs](/forum/32-content-creation/862218-two-canonical-urls#124590 "Hello,  On my every page, there are canonical URLs already indicated by default. And the canonical URLs for categories are indicated as:  - which is against the structure of my site. I want to change it. How can I do it?  If I put a correct canonical URL into the appropriate field at the category edit page, as result I am getting both canonical URLs in the code of the same page:   and the new one follows below:   So, how can I remove the first incorrect canonical URL?  -- HikaShop version -- : 2.2.1 -- Joomla version -- : 3.1.1 -- PHP version -- : 5.3.27")* was created by *[watashi](/forum/user/8585-watashi "View watashi's Profile")*

Hello,

On my every page, there are canonical URLs already indicated by default. And the canonical URLs for categories are indicated as: &lt;link href="[ www.mysite.com.ua/products/brands/bershka/product/listing](http://www.mysite.com.ua/products/brands/bershka/product/listing)" rel="canonical" /&gt; - which is against the structure of my site. I want to change it. How can I do it?

If I put a correct canonical URL into the appropriate field at the category edit page, as result I am getting both canonical URLs in the code of the same page:

&lt;link href="[ www.mysite.com.ua/products/brands/bershka/product/listing](http://www.mysite.com.ua/products/brands/bershka/product/listing)" rel="canonical" /&gt;
and the new one follows below:
&lt;link rel="canonical" href="[ www.mysite.com.ua/products/brands/bershka](http://www.mysite.com.ua/products/brands/bershka)" /&gt;

So, how can I remove the first incorrect canonical URL?

-- HikaShop version -- : 2.2.1
-- Joomla version -- : 3.1.1
-- PHP version -- : 5.3.27

Last edit: 13 years 2 months ago by [watashi](/forum/user/8585-watashi "View watashi's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODYyMjE4LXR3by1jYW5vbmljYWwtdXJscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

13 years 2 months ago [\#124632](#124632) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Two canonical URLs](/forum/32-content-creation/862218-two-canonical-urls#124632 "Hello,  On my every page, there are canonical URLs already indicated by default. And the canonical URLs for categories are indicated as:  - which is against the structure of my site. I want to change it. How can I do it?  If I put a correct canonical URL into the appropriate field at the category edit page, as result I am getting both canonical URLs in the code of the same page:   and the new one follows below:   So, how can I remove the first incorrect canonical URL?  -- HikaShop version -- : 2.2.1 -- Joomla version -- : 3.1.1 -- PHP version -- : 5.3.27")*

Hi,

The first incorrect canonical URL is not added by HikaShop, HikaShop only adds the second one if you specify it in the product/category.
The first one must come from a third party extension which adds it automatically to all the pages so removing/disabling that extension or the canonical URL option of that extension should remove it. It could be a SEF extension or a SEO extension you installed.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODYyMjE4LXR3by1jYW5vbmljYWwtdXJscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[watashi](/forum/user/8585-watashi "View watashi's Profile")**
- [![watashi's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8585-watashi "View watashi's Profile") Topic Author
- [ Offline](/forum/user/8585-watashi)

Less More

- Posts: 120
- Thank you received: 1
-
-
-

13 years 2 months ago [\#124638](#124638) by [watashi](/forum/user/8585-watashi "View watashi's Profile")  Replied by *[watashi](/forum/user/8585-watashi "View watashi's Profile")* on topic *[Two canonical URLs](/forum/32-content-creation/862218-two-canonical-urls#124638 "Hello,  On my every page, there are canonical URLs already indicated by default. And the canonical URLs for categories are indicated as:  - which is against the structure of my site. I want to change it. How can I do it?  If I put a correct canonical URL into the appropriate field at the category edit page, as result I am getting both canonical URLs in the code of the same page:   and the new one follows below:   So, how can I remove the first incorrect canonical URL?  -- HikaShop version -- : 2.2.1 -- Joomla version -- : 3.1.1 -- PHP version -- : 5.3.27")*

Nicolas, thank you!

However, I do not have any special SEF plugin/component/module installed.
Indeed, the first canonical URL was inserted by Joomla's core plugin. So, this seems to be a bug of Joomla.

As a workaround, I have edited file **/plugins/system/sef/sef.php** by commenting the following lines:
Code:

// if ($uri !== $link) // { // $doc-&gt;addHeadLink(htmlspecialchars($link), 'canonical'); // }

Now the first incorrect canonical URL has gone!

This is, however, a core file hack. If anyone wants to implement it, don't forget to put it into your core hack log record.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODYyMjE4LXR3by1jYW5vbmljYWwtdXJscz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.055 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
