Hybris URL structure

3k Views Asked by At

We are using the Hybris platform, and our products URL are like below.

I am new to Hybris platform but I know about URL structure, and I think something is going wrong here. I've checked other Hybris sites and other Hybris sites have short and clean URLs. Any suggestion?

http://shop.cintas.com/store/site/c/Southport-Skirt/p/11361733?searchText=:price-asc&plpcategoryCode=Eco
http://shop.cintas.com/store/site/Apparel/Headwear/Knit-Cap/p/00013120?searchText=:price-asc&plpcategoryCode=Apparel
3

There are 3 best solutions below

0
mkysoft On

These urls generated by Apparel sample accelerator, you can create your own URL Strategy. You need development for it.

2
Mafick On

Your question is very common... So hard to answer... But for the ProductPageController there is a logic that all sites on

/**/p/{productCode}

Are handled by the ProductPageController. There is a logic that pages ends with /p/{productCode} will handle the request and replace the front part with the name of a product,...

Mabye this helps you and you can more specify your question?

BR

0
Johannes von Zmuda On

You can change the URLs by changing the ProductModelUrlResolver and ProductDataUrlResolver. Hybris uses them to determine the URL for products throughout the system. Keep in mind, that the URL needs to end with the pattern of the ProductPageController "/**/p/{productCode}".

You can replace the bean declaration. There is even some possibility to configure the resolvers via a URL pattern (see attribute "defaultPattern" of ProductModelUrlResolver). However for further adaptions, you need to change the implementation of the classes.

See classes:

de.hybris.platform.commerceservices.url.impl.DefaultProductModelUrlResolver
de.hybris.platform.commercefacades.url.impl.DefaultProductDataUrlResolver

and corresponding beans:

productModelUrlResolver
productDataUrlResolver

See also my post here: How to normalize URLs in Hybris