Keyword

Duplicate k2 category listing

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
3 years 4 months ago #179245 by Goble002
Duplicate k2 category listing was created by Goble002
Hello,

I have a menu item for a k2 category. So items will be listed in : domain.com/menu-alias/

However Google indexed the following :
domain.com/menu-alias/content/cat-alias/?start=210
domain.com/menu-alias/content/cat-alias/?start=105
and so on (quite a lot of them with each link with different page numbers).

I wasn't aware that these links existed before Google indexed them (though these were not submitted for indexing). I have asked for a temporary removal but I will need to remove the links from the site somehow. 

Any idea ?

Please Log in or Create an account to join the conversation.

More
3 years 4 months ago #179284 by JoomlaWorks
Replied by JoomlaWorks on topic Duplicate k2 category listing
Do you have Advanced SEF enabled in K2?

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
3 years 4 months ago #179293 by Goble002
Replied by Goble002 on topic Duplicate k2 category listing
Hi Fotis,

the settings are in the snapshot. 
Attachments:

Please Log in or Create an account to join the conversation.

More
3 years 4 months ago #179295 by JoomlaWorks
Replied by JoomlaWorks on topic Duplicate k2 category listing
Switch "Enable custom SEF settings for K2 URLs" to "No".

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
3 years 4 months ago #179306 by Goble002
Replied by Goble002 on topic Duplicate k2 category listing
Hi and thanks,

however this will add :
/item/ in my k2 items URL
/itemlist/tag/ in my k2 tags

I cannot afford to create menu items for these 500+ k2 items and Google has already index them.

May be a small trick in htaccess or somewhere else ?

Please Log in or Create an account to join the conversation.

More
3 years 4 months ago #179308 by JoomlaWorks
Replied by JoomlaWorks on topic Duplicate k2 category listing
Try replacing the file /components/com_k2/router.php with this one jmp.sh/CZ2oMKG from K2 v2.10.2. Clear your caches and check again.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
3 years 4 months ago #179309 by JoomlaWorks
Replied by JoomlaWorks on topic Duplicate k2 category listing
For the record, for the next update of K2 there will be 4 URL router options: the default one, the one up to K2 v2.10.2, the one used in v2.10.3 and a new one which is both performant as the default one yet can be smartly optimized for improved URL structures.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
3 years 4 months ago #179320 by Goble002
Replied by Goble002 on topic Duplicate k2 category listing
Hello and thanks Fotis,

I compared this file with my actual one. It is exactly the same. I guess, it was recommended I use this newer version of router.php to solve a previous issue (but I can't find the post).

Anyway I can wait for next version of K2 and see if it solve my issue.

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago #180067 by natecovington
Replied by natecovington on topic Duplicate k2 category listing
I'm having a similar issue (I think) where my SEM Rush audit is coming back with all sorts of different URL's for my category pages:


It's a K2 + SH404sef site that has been migrated / upgraded from Joomla 2.5.x so I'm hesitant to start flipping switches.  

It might even be because I was using an outdated version of the K2 -> SH404sef plugin for a while.  I think that's all current now, too.  

Can you point me in the right direction? 

Thanks!
-Nate
Attachments:

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #180100 by JoomlaWorks
Replied by JoomlaWorks on topic Duplicate k2 category listing
Here's the thing. Crawlers can be dumb, that's why you see the repeating "start=" query parameter. I've found Bing usually does the stupid crawling.

If it's just this, it can be mitigated by checking all query params in Joomla URLs (not just K2), filtering them all out for duplicates and redirecting when necessary.

I would recommend using the plugin URl Normalizer github.com/joomlaworks/url-normalizer and then add the following code block in line 30 of the file github.com/joomlaworks/url-normalizer/blob/master/plugin/urlnormalizer.php:
        // Filter duplicate URL parameters
        $currentAbsoluteUrl = JUri::getInstance()->toString();
        if (strpos($currentAbsoluteUrl, '?') !== false) {
            $currentAbsoluteUrl = str_replace('??', '?', $currentAbsoluteUrl);
            $urlQuery = parse_url($currentAbsoluteUrl, PHP_URL_QUERY);
            if (strpos($urlQuery, '&') !== false) {
                $urlParams = explode('&', $urlQuery);
                $currentParamCount = count($urlParams);
                $filteredUrlParams = array_unique($urlParams);
                $newFilteredUrlParams = array();
                foreach ($filteredUrlParams as $filteredUrlParam) {
                    if (strpos($filteredUrlParam, '=') !== 0) {
                        $newFilteredUrlParams[] = $filteredUrlParam;
                    }
                }
                sort($newFilteredUrlParams);
                $filteredUrlParams = $newFilteredUrlParams;
                $newParamCount = count($filteredUrlParams);
                if ($newParamCount < $currentParamCount) {
                    $newUrlQuery = implode('&', $filteredUrlParams);
                    $newAbsoluteUrl = str_replace($urlQuery, $newUrlQuery, $currentAbsoluteUrl);
                    $app->redirect($newAbsoluteUrl, 301);
                }
            }
        }

I've been using this on high-traffic K2 sites and it works like a charm, mitigating Bing's crappy crawler.

Also consider creating a hidden menu item pointing to all K2 categories with a generic name and URL alias (important), e.g. "All Content" and URL alias "content", so that auto-generated pages like tags and user profiles result with URLs in the form of /content/tag/some_tag_here or /content/user/ID-some_username_here etc.

The latter boils down to how the Joomla URL router works and its a common issue on all Joomla components, not just K2.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum