Skip to main content
Updated and highlighted the description
Source Link
Sumit Bhatia
  • 5.9k
  • 2
  • 9
  • 25

I am using next.jsnext.js multisite plugin

https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/the-next-js-multisite-add-on.html

I have configureconfigured 2 sites in env.sites env.sites, cft and mpoc. JSS app name is cftcft. I have created _site_cft_site_cft and _site_mpoc_site_mpoc rewrite paths under src/pages. But, the app always fetches cftcft layout data even for mpocmpoc hostname. I have turned on the debugger on middleware and added some logs. The middleware is redirecting correctly but getstaticpaths context in [[,,path]].tsx file not containing site rewrite path. Due to this, page props factory always calling layoutdatalayoutdata of cftcft

enter image description here

enter image description here

Will be great if someone can help on this

Thanks

I am using next.js multisite plugin

https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/the-next-js-multisite-add-on.html

I have configure 2 sites in env.sites cft and mpoc. JSS app name is cft. I have created _site_cft and _site_mpoc rewrite paths under src/pages. But, the app always fetches cft layout data even for mpoc hostname. I have turned on debugger on middleware and added some logs. The middleware is redirecting correctly but getstaticpaths context in [[,,path]].tsx file not containing site rewrite path. Due to this, page props factory always calling layoutdata of cft

enter image description here

enter image description here

Will be great if someone can help on this

Thanks

I am using next.js multisite plugin

https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/the-next-js-multisite-add-on.html

I have configured 2 sites in env.sites, cft and mpoc. JSS app name is cft. I have created _site_cft and _site_mpoc rewrite paths under src/pages. But, the app always fetches cft layout data even for mpoc hostname. I have turned on the debugger on middleware and added some logs. The middleware is redirecting correctly but getstaticpaths context in [[,,path]].tsx file not containing site rewrite path. Due to this, page props factory always calling layoutdata of cft

enter image description here

enter image description here

Will be great if someone can help on this

Thanks

I am using next.js multisite plugin https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/the-next-js-multisite-add-on.html

https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/the-next-js-multisite-add-on.html

I have configure 2 sites in env.sites cftcft and mpocmpoc. JssJSS app name is cft. I have created _site_cft and _site_mpoc rewrite paths under src/pagessrc/pages. But, the app always fetchingfetches cft layout data even for mpoc hostname. I have turned on debugger on middleware and added some logs. The middleware is redirecting correctly but getstaticpathsgetstaticpaths context in [[,,path]].tsx[[,,path]].tsx file not containing site rewrite path. Due to this, page props factory always calling layoutdata of cft

enter image description here

enter image description here

Will be great if someone can help on this

Thanks

I am using next.js multisite plugin https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/the-next-js-multisite-add-on.html

I have configure 2 sites in env.sites cft and mpoc. Jss app name is cft. I have created _site_cft and _site_mpoc rewrite paths under src/pages. But, app always fetching cft layout data even for mpoc hostname. I have turned on debugger on middleware and added some logs. The middleware is redirecting correctly but getstaticpaths context in [[,,path]].tsx file not containing site rewrite path. Due to this, page props factory always calling layoutdata of cft

enter image description here

enter image description here

Will be great if someone can help on this

Thanks

I am using next.js multisite plugin

https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/the-next-js-multisite-add-on.html

I have configure 2 sites in env.sites cft and mpoc. JSS app name is cft. I have created _site_cft and _site_mpoc rewrite paths under src/pages. But, the app always fetches cft layout data even for mpoc hostname. I have turned on debugger on middleware and added some logs. The middleware is redirecting correctly but getstaticpaths context in [[,,path]].tsx file not containing site rewrite path. Due to this, page props factory always calling layoutdata of cft

enter image description here

enter image description here

Will be great if someone can help on this

Thanks

Source Link

Next.js multisite plugin context is not returning rewrite path

I am using next.js multisite plugin https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/the-next-js-multisite-add-on.html

I have configure 2 sites in env.sites cft and mpoc. Jss app name is cft. I have created _site_cft and _site_mpoc rewrite paths under src/pages. But, app always fetching cft layout data even for mpoc hostname. I have turned on debugger on middleware and added some logs. The middleware is redirecting correctly but getstaticpaths context in [[,,path]].tsx file not containing site rewrite path. Due to this, page props factory always calling layoutdata of cft

enter image description here

enter image description here

Will be great if someone can help on this

Thanks