- Posts: 38
COMMUNITY FORUM
K2 SEO issue - Can it be fixed?
- chilly_bang
-
- Offline
- Junior Member
Please Log in or Create an account to join the conversation.
- Michelle
-
- Offline
- New Member
- Posts: 3
I tried inserting your hack but nothing changed. I'm not very good at this type of thing. Is there somewhere specific within the category item php file where I should insert the hack? Thanks for the help. This entire thing is extremely frustrating with the duplicate links.
Please Log in or Create an account to join the conversation.
- Yiannis K
-
- Offline
- New Member
- Posts: 4
chilly_bang wrote: Hi all!
Here the hack to avoid duplicated URLs
For an item:
take the file: components/com_k2/templates/default/item.php from your K2 template. AddFor a category:<?php if ($this->item->link!= JRequest::getURI()) JApplication::redirect($this->item->link,'','' ,true); ?>
take the file
components/com_k2/templates/default/category_item.php from your K2 template. Add<?php $this->original_link = JRoute::_(K2HelperRoute::getCategoryRoute(JRequest::getVar('id'), 0)); if (JRequest::getInt('start') > 0) $this->original_link .= "?start=" . JRequest::getVar('start'); $this->real_link = JRequest::getURI(); if ($this->original_link != $this->real_link) JApplication::redirect($this->original_link,'','' ,true); ?>
The hack will redirect all duplicated urls to the single right one.
Use at your own risc and remember:
with this hack no parameter can be pushed with any url. Your print pages etc will not work anymore (print page will be loaded WITH template).
I couldn't use multiple categories in menu. Returned a 404 error, so I had to remove the categories hack at least..
Please Log in or Create an account to join the conversation.
- Creative Immense
-
- Offline
- New Member
- Posts: 3
The hack to avoid duplicated URLs from Chilly_bang is working but I still have the item id number in the link.
Is there someone who knows how to remove the item id from the link.
I have for example: http://www.yoursite,com/item/16-joomla-k2-problem-item-id.html but I want it like this http://www.yoursite,com/item/joomla-k2-problem-item-id.html without the item id number.
Please can someone help me?!
Greetings Mike
Please Log in or Create an account to join the conversation.
- Creative Immense
-
- Offline
- New Member
- Posts: 3
New k2 update and the SEO problem is fixed!!
Everthing works great! Good work k2! :-)
Greetings Mike
Please Log in or Create an account to join the conversation.
- Ganesamoorthy N
-
- Offline
- New Member
- Posts: 1
Mike wrote: Hello everybody,
New k2 update and the SEO problem is fixed!!
Everthing works great! Good work k2! :-)
Greetings Mike
Could you please mention the version of k2, because i have same issues with the version 2.6.3
Please Log in or Create an account to join the conversation.
- Creative Immense
-
- Offline
- New Member
- Posts: 3
K2 v2.6.5 but I still have the SEO problem. So I put the fix back in the item.php
Greetings Mike
Please Log in or Create an account to join the conversation.
- Neil Forrester
-
- Offline
- Junior Member
- Posts: 25
I have been looking into this issue myself and even went down the route of employing someone in htaccess coding skills to rewrite the URL.
After spending too many hours on this I now have it working.
- Back up your site using Akeeba Backup
- Download the latest version of K2 which is currently K2_v2.6.5.zip.
- Remember, if you have made any changes to the K2 CSS files without creating an override they will be written over. So keep any necessary files.
- Install K2_v2.6.5.zip via Extensions Manager
- Now go to Components / K2
- Click the Parameters button top right
- A window opens up - click the Advanced tab
- Scroll down to Advanced SEF Settings
- Enable advanced SEF for K2 URL's - Yes
- Use the item ID in the URL - No
[img size=74kb]www.pixelfire.com.au/images/k2-sef-settings.png[/img]
Save and close.
These settings have worked for me. I wish I had only upgraded my K2 before spending too many bloody hours on this issue. Oh well - it's working fine now and it's great.
Don't forget, if you have a few Items that people access through a category listing you will need to update the redirects for their URL's which I now need to do so I'll have to disable the new SEF until I have a full list of redirects I need to set up.
Example URL change:
www.pixelfire.com.au/website-and-graphic-design-blog/item/121-top-10-joomla-extensions
Now becomes:
www.pixelfire.com.au/website-and-graphic-design-blog/top-10-joomla-extensions
Also this guy at the bottom of this URL has some good ideas for avoiding duplication of URL using the No Numbers Sourcerer and the rel="canonical" tag. It's worth a look.
forum.joomla.org/viewtopic.php?t=624631
Hope that helps.
Cheers,
Neil.
Please Log in or Create an account to join the conversation.
- Neil Forrester
-
- Offline
- Junior Member
- Posts: 25
www.pixelfire.com.au/website-and-graphic-design-blog/item/122-how-to-remove-item-and-item-id-from-a-k2-url
I hope this helps all of you :)
Good luck.
Please Log in or Create an account to join the conversation.
- Passy
-
- Offline
- New Member
- Posts: 5
How can remove component/k2/ from my URL
For example:
www.domain.de/component/k2/article
to
www.domain.de/article
Thank you for your help :-)
Please Log in or Create an account to join the conversation.
- Neil Forrester
-
- Offline
- Junior Member
- Posts: 25
Not sure but you can try this:
- Go to Components / K2
- Click Parameters top right
- A modal box opens. Click the Advanced tab
- Scroll down to Advanced SEF Settings
Set 'Use the category ID in the URL' to No
You need to ensure you have an .htaccess file in the public_html folder and enabled SEF URL's in Site / Global Configuration.
Other than that not sure really. I hope that helps though.
Thanks,
Neil
Please Log in or Create an account to join the conversation.
- Passy
-
- Offline
- New Member
- Posts: 5
My attitudes, are that way as you had said it. But unfortunately, it doesn't work.
I know what I shall not do any more. Have very much tried out. :-(
Passy
Please Log in or Create an account to join the conversation.
- Neil Forrester
-
- Offline
- Junior Member
- Posts: 25
I translated the text on the page and can see that it's your '404 page not found' page.
Here's what you need to do to create a 404 page with a nice URL
Create another menu in Joomla. This will be a hidden menu that won't be seen at the front end.
Go to Menus / Menu Manager / Add New Menu
For the Title put - Hidden Menu
Menu type - Hidden Menu
Description - Hidden Menu
Save and Close
We now need to add a menu item to this menu.
Go to Menus / Hidden Menu
Click New
Give the menu a title such as: 404-Error-Page-Not-Found
Alias: 404-Error-Page-Not-Found
This will make your URL: www.domain.de/404-Error-Page-Not-Found
Make sure the link is published to the Hidden Menu.
Edit the error.php
Go to public_html / templates / yourtemplate / error.php
We need to edit this file: error.php
Find the text:
defined('_JEXEC') or die;
if (($this->error->getCode()) == '404') {
header('Location: /404-Error-Page-Not-Found');
exit;
}
Ensure the location is the URL of the new menu link to the 404 page we have just created.
Fingers crossed that should solve your issue.
Cheers,
Neil.
Please Log in or Create an account to join the conversation.
- Passy
-
- Offline
- New Member
- Posts: 5
The Website "www.domain.de" isn't my Website - This was an example. sorry for the misunderstanding. My real website is " www.newdooclips.de/ " btw. " www.newdooclips.de/component/k2/cookiebreed-erfolg-durch-scream-tutorials " - Take a look as URL.
I know what we cannot do extremely any more yet. I have this problem already for 2 weeks.
Thank you very much Neil :)
Please Log in or Create an account to join the conversation.
- Emanuel Rodríguez
-
- Offline
- Elite Member
- Posts: 284
Disallow: /tag/
Disallow: /blog/
Disallow: /search/
At least you are blocking some duplicate urls from indexing.... I think....
Please Log in or Create an account to join the conversation.
- Neil Forrester
-
- Offline
- Junior Member
- Posts: 25
I believe the reason your URL shows component/k2 etc is because you don't have any menu items linking to those categories.
Try making a hidden menu item that links to the blog category. Hopefully that will fix up the issue.
Plus, when you create the K2 Content module to pull in the information - select the relevant category eg: blog. That might get rid of component in the URL.
Otherwise I'm not sure really as it depends on how you might have set up your site.
One thing you should know though is that your site takes quite a while to load in.
Cheers,
Neil.
Please Log in or Create an account to join the conversation.
- Barry Seward
-
- Offline
- New Member
- Posts: 1
I had the same issue as Passy and was pulling my hair out. Creating a menu worked like a charm! Thanks
Please Log in or Create an account to join the conversation.
- Myorai
-
- Offline
- Junior Member
- Posts: 24
yaksushi wrote:
Peter wrote: Hey has the duplicate url issue discussed in the fist post (7 months ago) been resolved, because if it hasn't why is Admin telling us to get sh404sef ?
I have been building my site for months now using K2 and today - when I almost finished - to my surprise I realized that K2 has been building a lot of duplicated URLs. The guys over at anything-digital said that it's a K2 issue and not a sh404SEF issue, which is cleary true.
First the damn tags are producing a duplicated URL every time an article has been posted with already an existend tag. This describes it pretty well.
This issue is not new to K2, related threads has been posted in the past with not so useful solutions.
It seems to me sh404sef developers blame k2, who blame Joomla in the meantime nothing changes, it seems the ball is squarely in k2's court, why not get together with anythingdigital to make & sell a plugin that works gets rid of this duplicate content problem once & for all instead of passing the buck.. The way i see it it's in every bodies best interest to get this sorted.
Peter I 100% agree! I'm still waiting on a solution to this issue.
I must agree as well.
I will be happy to pay for a solution to this problem - as K2 is the best CCK i know for Joomla, but afcourse with this SEO problem t's not possible to use on sites that actually want to have alot of traffic.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
K2 uses the default Joomla! router for its URLs.
You have two options either use Joomla!'s default router, map your content in menu items and try K2's advanved SEF (Read this blog post. getk2.org/blog/1169-k2-v265-released)
If you are still having issues with duplicate content you can always develop or use a canonical tag K2 plugin.
This way even if you have similar content it two pages Google will always 'look at' the original content and disregard any other URLs.
The second option is to bypass and not use Joomla!'s router altogether. For this solution you will need an SEO extension (it has already been stated in this thread) and use the extension's router to handle all URLs, canonical tags and 301 redirects. Make sure though your SEO/SEF extension supports K2 or has a K2 integration. From that point it is up to extension to have clean urls and good SEO.
I have personally tried both solutions (even a hybrid one) and I have to say both worked in production sites with a lot of traffic.
Please Log in or Create an account to join the conversation.
- Roy
-
- Offline
- New Member
- Posts: 3
I am using Joomla Voxel responsive version. I am facing an issue with the URL. URLs are coming with item number. Secondly, each URL has two titles - 1) one is without ITEM number, and 2) One is without ITEM number.
For example:
In below URL, "sustainability-and-bim" is mentioned twice - one is without item number (40) and one is with ITEM number (40).
www.architecturalevangelist.com/building-information-modeling/sustainability-and-bim/40-sustainability-and-bim.html
While the DESIRED URL should be www.architecturalevangelist.com/building-information-modeling/sustainability-and-bim.
Currently Google is indexing a single URL three times like:
a) www.architecturalevangelist.com/building-information-modeling/sustainability-and-bim/40-sustainability-and-bim.html
b) www.architecturalevangelist.com/building-information-modeling/sustainability-and-bim/40-sustainability-and-bim.html
c) www.architecturalevangelist.com/building-information-modeling/40-sustainability-and-bim.html
Please help me how to fix these issues.
Looking forward to your help.
Please Log in or Create an account to join the conversation.