Avatar vertigo asked

ZOO - Remove /item and /category from the URLs

There is a long discussion about this.
Yes, I know you are not planning to remove /item and /category from the URLs of ZOO, but I think that if enough people vote for this, you might start listening to your customers.

If we use internal menu items for ZOO items or categories, it causes duplicate content because it also generates another URL with the same content.

Adding /item and /category in the URLs just because you want to allow items and categories to have the same aliases is a very bad idea.

This request is for those who want to use Joomla SEF so please don't start recommending other SEF components as a solution to this problem.

Your product should work perfectly with Joomla SEF and it should not cause duplicate content when using internal menu items because of /item and /category.

Vote for it if you want it to be fixed.

  • Joomla
  • ZOO
  • Feature Request
  • Bug Report

30 Answers

3

Avatar weble answered

Hi, i voted for this even if i don't think your way of "suggesting" is the right one.
My idea here is that ZOO does work with Joomla's SEF already and perfectly. It follows already all the REST patterns, since a category is really a different resource than an item, so it's normal that its url it's different from an item.

What i think should be right is to remove the /item from the url, maybe replacing it with the type alias. That way you could have something like clocks/clock/clockname as an url.

About content duplication, that's a true problem, not just an excuse. Try imagining: if you have a category "Clock" and an item "Clock", both of them with alias "clock". Then you'll try to go to .../clock. What should ZOO open? the category? and then how to access the item?

3

Avatar vertigo answered

Guys, before answering, please make sure you understand the whole problem.

Make an internal menu item for 1 ZOO item and 1 ZOO category and compare those URLs with those of the other ZOO items and categories.

To avoid duplicate content when internal menu items are created, the only things that should be done are to make the aliases unique across items and categories and to remove /item and /category.

1) The URLs of ZOO items and category should be like this:

example.com/alias (of an item or of a category)

So it should be exactly like it is now, but without /item and /category.

This solution is very flexible.

This way, if you have an item in 10 categories, that item has only 1 URL, not 10 (so there is no duplicate content), because the /categoryalias in not inserted in the URL.

Yes, for multiple categories, ZOO also adds category_id=xx after the SEF URL, but you can remove that by adding unset($query['category_id']); in router.php at line 100 in ZOO 2.5.

2) If you want the category alias in the URL like this,

example.com/categoryalias/alias

then just make an internal menu item for that category and Joomla (not ZOO) will insert it in the URL.

All items in that category will have URLs like this

example.com/categoryalias/alias

But saying that ZOO should add the /categoryalias or /typealias by force in the URL is WRONG.
It generates duplicate content when you make an internal menu item or if you have items in multiple categories.

You can have any words you want in the URLs of items and categories by making internal menu items. Those words are the aliases you set in the Joomla menu item.

Edited

1

Avatar weble answered

@vertigo please don't get so upset about this, it's a simple topic. No need to get angry ;)

1) In joomla, aliases are unique per menu items and for items of the same type, such as articles. but an article can have the same alias of a category. That's the same for zoo. Why should they limit the alias to be unique across categories and items? they are different resources, they should NOT have the same url structure.

2) i agree that the /item is not a good solution. My proposal would be:
- /alias should point to a category. Always
- /typealias/alias should point to the item itself

this way, you get far better url structures, and you can keep url consistency.

Edited

1

Avatar weble answered

Hi again, if think you're mistaking on the concept of alias. Joomla has that unique url alias feature because the only thing that matters to it is the page, which is a unique resource. I agree that zoo could check if joomla has an url for that particular item, and if so, use that one instead of this own, but i think you will not likely add each item to your site menu just to be able to have your SEF url as you want.

My comment on the type was not to add the /type suffix, but the /typealias suffix, which for example could be /watch/rolex or /page/title or /automobile/lamborghini/

My point here is that saying that the alias should be unique across all the entities on zoo is wrong by itself:

  • Why can't i have a category an an item with the same alias but a different path? That's very common! I can have a category which has to have the same alias as an item of mine, just a different path (/automobile/automobile (item) and /automobile (category))
  • There are also other entities other than categories and items, such as tags. If i set a tag as zoo, should that mean that i cannot create an item with that alias?
  • In the HTTP protocol, a resource is not defined by its alias but by its URI which is the entire path, not the alias itself
  • Joomla has not a real Resource Oriented Architecture at his core, which makes it a little awkward to manage this kind of things, because there isn't a "Joomla way" of doing this.

My solution:

  • Let the category have the alias priority. At the same category level, item and category cannot have the same alias (ex: in the root there can either a category or an item with alias "zoo")
  • The item url should always be the category path plus its alias. That means that an item doesn't have a single url, since one item could be in different categories. That's also correct, since i may want to show different things based on its current category
  • The item url could also contain its type alias, to raise its SEO power. If i have a catalogue of jewelry, i would like the word "jewel" to be in each url of my jewels (..../jewel/name) so my site gets a boost for the "jewel" keyword. This could be optional
  • The tags should be always prefixed by /tag/ since it's a search more than a browsing.

Hope to have been clear on my POV.

Edited

1

Avatar weble answered

Hi,
i get the problem (i got it since the first post actually). What you're missing here is how joomla manages the url aliases.

1) The URLs of ZOO items and category should be like this:
example.com/alias (of an item or of a category)
So it should be exactly like it is now, but without /item and /category.

If you want your SEF url to be http://example.com/alias the ONLY way of doing that is creating a root menu item with that alias. Period.
Plus, it's WRONG to have all urls on the roots. The url becomes less explicative, and your SEO goes down.

Yes, for multiple categories, ZOO also adds category_id=xx after the SEF URL, but you can remove that by adding unset($query['category_id']); in router.php at line 100 in ZOO 2.5.

This is very wrong again. If you do that, your breadcrumbs will always point to the wrong category, the primary one. ANd then your multiple categories feature becomes useless.

To avoid what you call "duplicate content", ZOO just have to check if there is a menu item in joomla that points to that resource, and use it where it finds. So if there is a menu item called "Blog" that points to the item "Blog" in the ZOO category "topic", it uses http://example.com/blog instead of http://example.com/topic/blog

Please understand that i see what you want to achieve, but that's not necessarily the thing that all wants, nor the right one. There are rules that the components have to abide, and there are best practices that are there to ensure how this things should work.

IMHO, my previous post explains very well a good balanced solution to achieve what you want AND keep the urls correct

0

Avatar kayhan Support answered

It was mentioned in the old forum already, but for posterity here again. To solve the problem you could also get 3rd party Zoo plugins

Should one really use Joomla SEF? Wouldn't it slow down your site a lot especially if you have many items, because Joomla doesn't remember any SEF urls and has to recalculate them every time?

Edited

0

Avatar vertigo answered

@ weble

The point is not to allow an item and a category to have the same alias. They can have the same name but, like it is in Joomla, the alias should be unique across items and categories.

/item and /category are in the URLs because the aliases are not unique. In ZOO you can have a category named Clocks with the alias clocks and a item with the same name and the same alias. But it shouldn't be like that.

The name of the item or category is the one that matters. The name is displayed on the page and it is seen by the visitors. The name is not required to be unique but the alias (the one that is in the URL) should be unique, exactly like it is in Joomla.

/item and /category should be removed and should not be replaced with anything else. If the alias is unique, there is no need to add /item and /category in the URL because Joomla or ZOO knows exactly what page to open.

0

Avatar vertigo answered

@ weble

Not angry at all :)
Perhaps I was just trying too hard to explain the problems.

Jan said that /item and /category are in the URLs because aliases are not unique across items and categories.

Adding /type as you suggest is the same thing as keeping /item or /category.
This is one of the causes of the duplicate content.

Just make an internal menu item for 1 ZOO item and for 1 category and look at the URLs from the menu and from ZOO.
If ZOO is the default menu item (homepage):
If you make an internal menu item for a ZOO item and you set the Joomla alias as iphone, the URL will be:
example.com/iphone/
This is all done only by Joomla.

But if you look in the ZOO category at the URL of that item you will see that it also has another URL:
example.com/iphone/item/iphone

So now there are 2 URLs for the same item.

It's the same thing for categories.
Joomla internal menu item:
example.com/electronics
and ZOO category:
example.com/electronics/category/electronics/

and there are also the URLs created by the pagination.

So adding something like /type or /item or /category is wrong.

/type/alias still generates duplicate content when an internal menu item is created.** Joomla would create a URL without /type and ZOO already has one with /type.**

In the URL there should be only the alias of the item or category to avoid duplicate content.

Please read the thread from the old forum also.

There is not need to add anything in the URL if the alias (not the name) of an item or category is unique.

The aliases could be similar but not identical. The aliases are visible only in the URL.

How many people would want to create an item and a category with the same name and alias anyway?
Again, items and categories can have the same name but the alias should be slightly different.

So /alias should point to the appropriate page.
If that alias is of a category, it should point to a category.
If that alias is of an item, it should point to an item.

0

Avatar morgan.gustafsson answered

Is there a manageable way to make a hack that changes this behavior in Zoo? It is probably a stupid question but I havent looked at how this is dealt with within zoo.

Thinking of changing the alias/slug functionality to include checks for both items and categories and to change whatever functions responsible for creating the urls.

0

Avatar vertigo answered

@weble

In Joomla 1.7 and ZOO 2.5, if the menu item of a ZOO app is the default one (the site's home page), the URLs are like this:
example.com/item/alias
example.com/category/alias

So there is no menu item alias in the URL if ZOO is the default menu. I used this form of URL in my examples and I already said that in one of my posts. Make ZOO the default menu item and take a look at the URLs.

So I am not wrong. This is done by Joomla 1.7.

If it is not the default menu, the URLs are like this:

example.com/menualias/item/alias
example.com/menualias/category/alias

ZOO does not insert the /categoryalias in the URL of an item as you suggest it should do. It inserts only the word /category.

My request is to simply remove /item and /category and to not add anything else in the URL.

If you want ZOO to add /categoryalias or /typealias in the URL and to create duplicate content when items are in multiple categories, please make a new feature request.

ZOO currently doesn't do that exactly for that reason.

But, for those who have items in only in 1 category and want the category names in the URLs of items, they could simply make an internal menu item for each category (if /item and /category are removed).

I also said that if an item is in multiple categories and one wants to remove that ?category_id=xx it can be done by modifying router.php.
I also kept saying in the forum that by doing so it makes the breadcrumbs always point to the main category. I have items in only 1 category and ZOO generates 2 URLs for each item: one with ?category_id=xx and one without category_id=xx.
So in this case to me it seems wrong not to remove category_id=xx. I always do.

This is just a modification, everyone is free to do what they like, I posted it here in case someone needs it.

Edited

0

Avatar weble answered

ZOO 2.5.4 fixed the content duplication issue. Try it and tell me if that works for you too :)

0

Avatar vertigo answered

ZOO 2.5.4 fixed the content duplication issue. Try it and tell me if that works for you too :)

Finally, some progress! :)
ZOO 2.5.4 fixed the URLs of the internal menu items of ZOO items.

@weble: If you had anything to do with it, thank you :)

What's left:

  1. The same thing needs to be done for the categories, including the links from the pagination.
  2. /item and /category must be removed. We shouldn't be forced to create internal menu items for each item and category just to get rid of /item and /category
0

Avatar smartini answered

Hi YOO,

we will use ZOO on a new site, ready end of march. After launch the links to the ZOO items should never change! No matter, if there are duplicate links and how complicated or long they are, they have to stay the same with every upcoming version of ZOO. This is very important for our customer, because the links will be used in QR-codes on packages and other prints.

Please keep our interest in mind. If you ever change the link-building of ZOO, please make it an option or make sure, that older links will still work.

Greetings,
Stefan

0

Avatar jan Yootheme answered

Hi duranno,

there should already be a rel="canonical" in the head section of your items view.

Regards,
Jan

0

Avatar brandonjmurray answered

just buy yoonique[.]net Zoo sh404sef plugin - really cheap and works like a charm!

0

Avatar phillip.madsen answered

Use the HTACCESS to adapt the url to what you need to remove. There are many tutorials all over on how to do this.

0

Avatar gjrweb answered

Is there a solution to get example.com/"categoryname"/alias.html instead of example.com/item/alias

If 3rd party plugins are needed, please let us know which ones...

0

Avatar zinfandel answered

hi guys, but in the end, the solution for remove "/item" and "/category"...is a good idea? the final result:
"category1/sub_category1/product1"
is better of
"category1/sub_category1/items/product1"

Do you not agree?

0

Avatar marco.serafini answered

not going to renew my zoo license till this important feature will be implemented.

0

Avatar roger.d.davis answered

I agree with philip madsen.... it seems this problem could be solved with the .htaccess file. this is a very long thread about a non-problem.

roger

0

Avatar marco.serafini answered

I pay for software developement, why should i do any hack?

Anyway you can't do that with .htaccess. This feature belongs to the component.

0

Avatar roger.d.davis answered

Absolutely this feature should be native to zoo. My business directory customers want a simple URL, like www.MySite.com/myCustomer . They want to put it on their business cards.

How can you have a respectable business directory without this feature????

0

Avatar infosys answered

Avatar phillip.madsen answered

Use the HTACCESS to adapt the url to what you need to remove. There are many tutorials all over on how to do this.

@Philip Madsen, can you post a sample of Rewrite Rule you made to do this? I tried doing it but nothing happened to my RewriteRule.

I'm trying to rewrite:

http://www.localhost.com/frontpage/directory

to

http://www.localhost.com/directory

Thanks!

0

Avatar scott.carter answered

Vertigo, have you found a work-around for this? I'm still looking. I would rather not have to spend time and money writing HTACCESS rules or purchasing yet another Joomla extension when I think it's just logical to have an option to remove the /item and /category fluff from the URLs. I'm wondering if there is any solution, as this was originally posted over a year ago.

0

Avatar federaltitle answered

I was having trouble with this, too, and in the end I did away with categories in my ZOO blog component. Now I'm using tags to organize content and URLs read "/blog/article-alias" This was the simplest way to work around the problem. (I'm using the JoomSEF component w/ the ZOO extension installed.)

0

Avatar dylan.phelan answered

Does anyone have an example of how to do this using htaccess?

I want to switch my directory from mosets tree to zoo, but i have to keep the urls the same!

0

Avatar dylan.phelan answered

Anybody? I like the idea of doing this with the htaccess file, but don't know how to...

0

Avatar olep answered

There is an easyer way to get it, tough not so clean:
create an hidden menu (without a showing modules) and assign every item/category to a menu item. It works very good.

It could be nonsense for those who run a blog.

Know someone who can answer? Share a link to this question via email or twitter.