× Here you can get community support related to ReDJ.

Remove K2 Category Prefix and ID

  • joomdude808
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 10 months ago #4628 by joomdude808
Remove K2 Category Prefix and ID was created by joomdude808
I need help modifying my K2 URL structure to ensure:

1) Access K2 category URLs without category prefix and ID (200 internal redirect, remove: content/XX-)
2) Redirect all native K2 category URLs to the non-prefix/ID URL version

Original URL:

/path/content/23-category

New URL:

/path/category

(note: category ID could be any number)

The Trick:
Restrict access to K2 native category URL (with prefix and ID), so for example any visitor trying to access "/path/content/23-category" should be redirected to "/path/category" and "/path/content/117-anothercategory" would redirect to "/path/anothercategory"

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

More
8 years 10 months ago #4630 by admin
Replied by admin on topic Remove K2 Category Prefix and ID
Hi,
what is not clear is if the destination URL already exists. I need to check a couple of real full URLs (old and new). If you prefer, send me an email at info(at)selfget.com with full URLs to call.

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

More
8 years 10 months ago #4631 by Nikola
Replied by Nikola on topic Remove K2 Category Prefix and ID
Hi, I use hikashop in my site, but hikashop url is very bad. For example:

suplementi.bg/categories-listing/aminokiselini/izolirani-amino/arginin-i-aakg/product/show/7656-amix-arginine-120-caps
or
suplementi.bg/brands/product/show/8946-arnold-series-iron-cre3-126

So the question is - How can I remove this parts from all product url:

/categories-listing/
/aminokiselini/izolirani-amino/
/product/show/7656/
/brands/
/show/8946/

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

More
8 years 10 months ago #4632 by admin
Replied by admin on topic Remove K2 Category Prefix and ID
Hi Nikola,
the basic problem here is that you need a better URL routing while ReDJ is mainly a redirect extension. Just to give you an example of problems to solve, you need to drop a piece of the "working URL" like /categories-listing/, but the new shortest URL doesn't work (because doesn't exist) so ReDJ should redirect it to the original one. It could be done internally (with the enterprise version) but you need to identify a "pattern" in the requestes URLs to match (an example, any URLs starting with /aminokiselini/izolirani-amino/).

After this first step where you created a rule to redirect the short to the long, you should also create a second rule that redirects any of the original URL (the long) to the short. And that's not all... folks.

The biggest problem is that your site and your extension (hikashop in this example) will continue to generate long URLs, so your site will still contain URLs redirected elsewhere... maybe you can create shortest URL with hidden menu items.

Kind regards,
Luigi

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

Time to create page: 0.179 seconds