Keyword

K2 ID Displays in URL Despite sh404SEF Settings

  • Red Deer
  • Red Deer's Avatar Topic Author
  • Offline
  • New Member
More
10 years 5 months ago #127165 by Red Deer
Instead of seeing the K2 item id in the URL like this:
http://www.mysite.com/index.php?option=com_k2&view=item&layout=item&id=333&Itemid=999

I'd like to see a category alias and an Item alias like this:
http://www.mysite.com/my_category_alias/my_item_alias

Created a menu of the individual K2 items and linked to those menu items from within a K2 Item, but I'm still getting the unaliased URLs.
  • The menu links in displayed menus do result in friendly URLs containing aliases instead of the full K2 item ids.
  • Only the links to the menu items from within a K2 Item do not display the alias.
  • Rebuilt menu, checked that menu links are to K2 individual Items, cleared and purged the Joomla cache, etc.

I'm sure I'm overlooking something obvious and will kick myself, but according to all the docs and search results, I seem to be doing the right thing. :blink: Anyone see the problem?

These are the site settings for Joomla 2.5.19 and K2 2.5.7:

(Global) SEO Settings
Search Engine Friendly URLs: Yes
Use URL rewriting: Yes
Adds Suffix to URL: No
Unicode Aliases: No
Include Site Name in Page Titles


(K2) sh404SEF Integration Settings
sh404SEF prefix for categories:
sh404SEF prefix for users/authors: author
category prefix for items only the last category:
Use Title Alias for sh404SEF URLs: Yes
sh404SEF prefix for the feed generated by the 'K2 Content' module: feed
Insert Item id in URL: No
Unique ID: No

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

More
10 years 5 months ago #127166 by Lefteris
Hi. K2 2.5.7 is outdated and not supported. You need to update K2 to 2.6.8. Remember to backup first. Regarding the links, are they generated by K2 or are you using a third-party extension? A link to your site would be very helpful.

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

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

  • Red Deer
  • Red Deer's Avatar Topic Author
  • Offline
  • New Member
More
10 years 5 months ago #127167 by Red Deer
Hi Lefteris,

Thank you for your reply.

Indeed I have upgraded to K2 2.6.8.

Most of the website content is in K2 (of course :) ). The first use case is:

I created a menu in which the menu items are linked to individual K2 Items. From within a K2 Item I link from text to a menu item so I can get a URL with the menu item alias. However the menu item alias is replaced by the K2 ID.

The second use case is:

I have also tried linking directly from text in one K2 Item to another K2 Item. The K2 Item alias or title is replaced with the K2 ID.

I'm not sure how to answer your question about whether the links are generated by K2. Certainly they appear to be since the category and id numbers are from K2 and I have no special third party product to generate links in this context. I do have other third party extensions that I suppose could interfere but they do not have sh404SEF parameters that I've set.

I'd be happy to send you the website link in a private message.

Kind regards,
Red Deer

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

More
10 years 5 months ago #127168 by JoomlaWorks
Replied by JoomlaWorks on topic Re: K2 ID Displays in URL Despite sh404SEF Settings
If you don't have sh404SEF installed, then these options you filled in the related sh404SEF section won't do anything. You can choose to use however the K2 Advanced SEF section and choose to not show the item ID. Then all you need to do to get the URLs you want is to just map your K2 categories to a menu in Joomla. You could just replicate your K2 category structure in your main Joomla menu. Simple :)

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

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

  • Red Deer
  • Red Deer's Avatar Topic Author
  • Offline
  • New Member
More
10 years 5 months ago #127169 by Red Deer
Hi Fotis,

Wow, thanks, I can't believe you take the time to answer beginner questions. :)

Here are the Advanced SEF Settings I'm using:

Enable advanced SEF for K2 URLs: Yes
Prefix for category URLs: content
Prefix for tag URLSs: tag
Prefix for user (author) URLs: author
Prefix for search results URLs: search
Prefix for date listing URLs: date
Prefix for Item URLs: None
Custom prefix for Item URLs: (left blank)
Use the item ID in the URL: No
Item ID and title alias separator: Use a dash
Use the item title alias: Yes
Use the category ID in the URL: No
Category ID and title alias separator: Use a forward slash
Use the category title alias: Yes

As a test, I used the same settings for K2 Advanced SEF on a Joomla 3.2 site I'm building on an internal system... and of course the menu alias appears in the URL perfectly as expected.

So it seems that I'm doing something wrong on the 2.5 site outside of K2 that is impacting the behavior. Not sure what it could be. It just occurred to me that if IT is using some fancy rewrite rules in .htaccess, maybe they could be interfering... yes, I'm grasping at straws. :unsure:

Thanks again!

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

More
10 years 5 months ago #127170 by Lefteris
@reddeer

When you say that you put links into text, what do you mean? Are you putting them inside a K2 item introtext/fulltext using the editor? Do you type the link manually or it is generated for you somehow?

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

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

More
10 years 5 months ago #127171 by Lefteris
This seems like a general site problem, not a K2 related problem. Since the link is there already, K2 does not alter it. It is the Joomla! SEF plugin that is handling the generated link. You should get the exact same behavior if you try to insert menu links to other components. So, one thing to do is it ensure that the system SEF plugin is enabled. Also ensure that the menu link you select in the editor is published in the menus manager.

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

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

  • Red Deer
  • Red Deer's Avatar Topic Author
  • Offline
  • New Member
More
10 years 5 months ago #127172 by Red Deer
The system SEF plugin has indeed been enabled all along.

Normal menu links to K2 Items do appear as alias names in URLs when the user clicks directly on a menu item.

The issue happens from links to menu items inside K2 Items. I'll test whether native Joomla content articles give the same behavior.

Thanks anyway.

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

More
7 years 4 months ago #161848 by Christos
I have k2 2.6.9 over joomla 3.7.0
and i face a problem with SEF urls and/or URL replacing.

Some links (from Custom HTML elements) to k2 categories show directory path e.g. x.x.gr/site2/component/k2/content/66-moria-metatheseon-2016-apeftheias-eyresi

and some links (from Custom HTML elements also) show x.x.gr/site/2014-12-22-11-31-34/2014-12-22-11-32-40

They are links created in JCE editor by clicking on link button and selecting k2 category (i installed "K2 Links for JCE" at some point..)

I have enabled "Search Engine Friendly URLs" and "Use URL Rewriting" in Configuration. I also have set "YES" in K2->Advanced the fields "Enforce SEF URL character replacements", "Enable advanced SEF for K2 URLs".

Could you please give me some directions? I dont have good understanding of SEF, URL replacing yet...

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 months ago #161859 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 ID Displays in URL Despite sh404SEF Settings
Hello,

Make sure to use latest versions of both K2 and K2 links for JCE.
In K2's (latest version) settings you can enable advanced SEF and create the URL patterns you want to use.

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