4

Now when I go to https://localhost:9002/ it opens hac (hybris admin console).

When I go to https://powertools.local:9002/nystorefront/powertools/en/USD/cart I can reach my storefront.

I want to reach mystore when I go to localhost:9002.

What should I do?

q-l-p
  • 4,304
  • 3
  • 16
  • 36
user9708984
  • 141
  • 3
  • 15

2 Answers2

4

I will assume your web extension name is mystorefront.

Add these into your config/local.properties

# This way hac extension will be available on https://localhost:9002/hac instead of https://localhost:9002/
hac.webroot=/hac  


# If you want to remap the context path to the root site on the web container
# then you must set these values to be blank, do not set them to be '/'
mystorefront.webroot=
storefrontContextRoot=

Also make sure that the urlPatterns associated with your CMSSite allow you to access your storefront via: https://localhost:9002/

You can also find this properties and additional information in your mystorefront/project.properties. As already mentioned there, "If you want to change these values then it is suggested that you override both of them in your config/local.properties file rather than changing the value here".

dj_frunza
  • 1,553
  • 3
  • 17
  • 28
  • Have you added the "hac.webroot=/hac " as well ? – dj_frunza May 15 '18 at 12:43
  • yes now it says ` WARN [hybrisHTTP7] [ContextInformationLoader] Cannot find CMSSite associated with current URL (https://localhost:9002)!` – user9708984 May 15 '18 at 12:51
  • This is because of the urlPatterns of the CMSSite which most probably contain mystorefront within – dj_frunza May 15 '18 at 13:47
  • Search the instance of your CMSSite and update it's urlPatterns attribute so that your extension will be accessible via https://localhost:9002 – dj_frunza May 15 '18 at 13:49
  • @user9708984 find my answer to resolve your error (Cannot find CMSSite associated ..) – HybrisHelp May 16 '18 at 05:04
  • can this be about this part of localproperties ` #website.powertools.http=http://powertools.local:9001/mystorefront #website.powertools.https=https://powertools.local:9002/mystorefront(i disabled because i dont need that. i need to direct this to mystore) website.mystore.http=http://localhost:9001 website.mystore.https=https://localhost:9002` in past , this was opening https://localhost:9002/powertools/en/USD/Open-Catalogue/Tools/Measuring-%26-Layout-Tools/c/1358 but i want to go to https://localhost:9002/mystore/en/USD/Open-Catalogue/Tools/Measuring-%26-Layout-Tools/c/1358 – user9708984 May 18 '18 at 06:53
  • Also try to add "powertools.webroot=/powertools" to override the extension's webroot – dj_frunza May 18 '18 at 09:22
2

You have to configure webroot and storefrontContextRoot in local.properties file.

1) Add properties to your config/local.properties, change mystorefront (mystorefront.webroot) with your storefront name. Also, need to change hac webroot to /hac

hac.webroot=/hac  

mystorefront.webroot=
storefrontContextRoot=

2) To open your site without passing query parameter(?site=mysite), run the below Impex. Change mysite with your CMSSite name. This will also resolve your error(Cannot find CMSSite associated with current URL).

$siteUid=mysite       

# CMS Site                                                                                                 
INSERT_UPDATE CMSSite ; uid[unique=true] ; urlPatterns                                                                                                                  ;      
                      ; $siteUid         ; (?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=$siteUid)(|\&.*)$,(?i)^https?://$siteUid\.[^/]+(|/.*|\?.*)$,(?i)^https?://[^/].*$ ;
HybrisHelp
  • 5,518
  • 2
  • 27
  • 65
  • I went to localhost:9002/hac/console/impex/import and imported that script. Used mystorefront instead of mysite. I tried to go to localhost:9002 after ant clean all but console now shows no error , only web shows server error . can not connect. then used my instead of mysite . it says `WARN [hybrisHTTP7] [DefaultCMSSiteService] More than one site associated with URL [https://localhost:9002]. Returning first.` because it is powertools, i should include also `powertools`? – user9708984 May 16 '18 at 07:07
  • Goto HMC/back office > cmssite > remove site "mystorefront' – HybrisHelp May 17 '18 at 07:39
  • There you will find another OOTB site, use that name in impex. You don't have to rebuild your server. – HybrisHelp May 17 '18 at 07:40
  • I went to hcms- websites `mysite true [] powertools Powertools Site false (i made this false) Powertools Content Catalog electronics Electronics Site true Electronics Content Catalog apparel-de Apparel Site DE true Apparel DE Content Catalog apparel-uk Apparel Site UK true Apparel UK Content Catalog` @HybrisFreelance now localhost can not be opened. and no log on console. – user9708984 May 18 '18 at 06:48
  • can this be about this part of localproperties ` #website.powertools.http=http://powertools.local:9001/mystorefront #website.powertools.https=https://powertools.local:9002/mystorefront(i disabled because i dont need that. i need to direct this to mystore) website.mystore.http=http://localhost:9001 website.mystore.https=https://localhost:9002` in past , this was opening https://localhost:9002/powertools/en/USD/Open-Catalogue/Tools/Measuring-%26-Layout-Tools/c/1358 but i want to go to https://localhost:9002/mystore/en/USD/Open-Catalogue/Tools/Measuring-%26-Layout-Tools/c/1358 – user9708984 May 18 '18 at 06:52
  • how can i contact, still continues – user9708984 May 28 '18 at 10:58
  • 1
    Drop me an email at contact@helphybris.com – HybrisHelp May 28 '18 at 15:01