cancel
Showing results for 
Search instead for 
Did you mean: 

How are pages loaded from a specific Accelerator URL

Former Member
 
Former Member
0 Kudos

Can you elaborate a little bit more the question or give some examples?

Former Member
0 Kudos

Example and refined questions

Given URL http://electronics.local:9002/yacceleratorstorefront/electronics/en/Open-Catalogue/Cameras/Hand-held...

The URL above will still resolve if I remove the portion of the URL seen below... /electronics/en/Open-Catalogue/Cameras/Hand-held-Camcorders

How does that happen? Are the portions of the URL which I removed (above) just displayed session information? Is the resolution of the URL to a page done by RequestMapping annotation or some other process?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

There are a few variables affecting your urls, let's go step by step:
First of all there will be one specified by your storefront extension, which is the one right after the the ip or ip and port, and it is defined in the project properties file with these two properties:

 tousstorefront.webroot=/yacceleratorstorefront
 storefrontContextRoot=/yacceleratorstorefront

If you leave these two properties empty, for instance your given url would be this: http://electronics.local:9002/electronics/en/Open-Catalogue/Cameras/Hand-held-Camcorders/c/584 Then the rest of the properties are site specific, hence they can be configured from the site.impex of your storefront. The first thing would be the URL resolver, which are the regex associated to a site to know which urls should redirect to each site. In the example of the electronicsstore you can check its impex in import/coredata and you will find the following url mappings:

 (?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=$siteUid)(|\&.*)$
 (?i)^https?://$siteUid\.[^/]+(|/.*|\?.*)$
 (?i)^https?://api\.hybrisdev\.com(:[\d]+)?/rest/.*$
 (?i)^https?://localhost(:[\d]+)?/rest/.*$

Being $siteuid "electronics". Anything matching these URLS will be considered as electronics site, so far so good.
Then the session comes in place, and whenever a site is matched via url (site is accessed) then the site is kept in the session and will remain there. Because of this, once the site is in the session this will have priority over the url matching, so whenever the storefront context root is matched and there is a site in the session this will be the one used with a matched page or a 404. In the case that you want to change from one site to another by default there is a property that can be added to url and will clean the session site, this property is ?clear=true. If you want to test if an url is being matched by a site, you can try to access it with that property at the end or just open it in a new incognito window.