Localhost Multisite Configuration

Andy Ewer asked on May 28, 2025 06:56

Hi,

There's a Kentico v13.0.20 Multisite that runs as expected on staging/prod servers, using the domains as licensed.

I have been attempting to get this all running as localhost on a dev machine. My understanding is that localhost should work with the licenses.

I am able to get one of the sites running as expected by setting either the Administration Domain Name or the Domain Alias to "localhost". I've not been able to get them all running together and switching, however. I tried setting up the sites as different localhost:port, and the URL does change when switching multisites, but the page seems to always redirect back to the one site set as "localhost".

I've had trouble finding any clear documentation or example to show me how to set this up. Please help!

Thanks!

Recent Answers


Juraj Ondrus answered on May 28, 2025 07:56

Could you please provide some sample values you have set as administration domain and presentation URL for each site? To start with, I would make sure the domain aliases are not set at all - nothing for admin or live site aliases to avoid confusion.

Or, try using 127.0.0.* instead of localhost.

0 votesVote for this answer Mark as a Correct answer

Andy Ewer answered on May 28, 2025 08:20

The site is headless, so the front end URL is handled outside Kentico.

I set up localhost:8005, localhost:8006, localhost:8007 as bindings in an IIS website and also in the Administration Domain of Sites in Kentico. Editing "Sites" works on any of them, but selecting a multisite in the dropdown gives me an "Invalid Website" error and "(current site)" in the dropdown.

If I change one to use localhost, then that one only works.

With your suggestion about using 127.0.0.* do you mean I should use 127.0.0.1, 127.0.0.2 and 127.0.0.3 as bindings on an IIS site and also as Administration Domain?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 28, 2025 08:31

What do you mean by headless? There has to be a Kentico 13 admin app and some front end app. And in the Kentico admin you configure the site's administration domain and presentation URL - so, what are the values set for site 1, site 2, etc.?

For example I have this:
- Site 1
.......Presentation URL: domain1.com
.......Administration domain: localhost

-Site 2
.......Presentation URL: domain2.com
.......Administration domain: localhost:8080

There are no domain aliases set and domain1.com and domain2.com are pointing to separate IIS sites, each pointing to a separate front end app project. The admin app is running in a third, separate IIS site.

0 votesVote for this answer Mark as a Correct answer

Andy Ewer answered on May 28, 2025 08:45

I think this might be a bit non-standard for an older version of Kentico. The Kentico has an API (written before my time) and the presentation URLs on stage/prod point to the front end, which is a separate NextJS application.

For my local, these are localhost:8000, localhost:8001, and localhost:8002. But I didn't think they mattered much with trying to get the back end only working.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 28, 2025 12:53

the localhost values you have set - are these administration domains or Presentation URLs?

0 votesVote for this answer Mark as a Correct answer

Andy Ewer answered on May 29, 2025 02:49

Presentation URLs

http://localhost:8000 http://localhost:8001 http://localhost:8002

Administration domains: localhost:8005 localhost:8006 localhost:8007

I just get "Invalid website" for all of them in the admin. If I change any one of the Administration domains to just "localhost" I can access the site in the admin.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 29, 2025 05:14

And what is your IIS configuration for the admin app? Are all the ports set for given website as bindings?

0 votesVote for this answer Mark as a Correct answer

Andy Ewer answered on May 29, 2025 05:29

Yes a single IIS website with bindings for localhost ports 8005, 8006, 8007.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 29, 2025 05:48 (last edited on May 29, 2025 07:36)

I have this setup and it works fine: Screen shot link

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.