Admin URL setup for Kentico 13

Ketan Hirapara asked on July 11, 2023 07:56

Hi all,

I have the application with Kentico(K13) v13.0.43

In IIS I am having the setup Like below structure.

LiveSite (Main site)

And under main site setup Admin site ad sub site.

ADMIN (Subsite)

Based on the above setup I am getting the URL like "https://domain.com/Admin/Admin" But I need to show URL Like "https://domain.com/Admin" and then the page GUID and all stuff should be there.

So, in short, need to remove Admin/Admin from the URL and need to show only Admin in the URL.

Please, anyone, have an idea to resolve this?

Also aware of separating site with subdomain and creating subsite as separate site but need to access admin like this only.

Thanks in advance. Ketan.

Recent Answers


Juraj Ondrus answered on July 11, 2023 09:52

This kind of setup is not recommended nor supported - having the admin app nested underneath the live site app. This can cause issues with several features like page builder, form builder, web farm sync and so on because IIS will detect nested web.config files and some configuration might clash or not being applied at all. Please see the documentation, which is also solution to your problem and which says: "The IIS applications for the live site and administration must run "side-by-side". Nesting one of the applications under the other causes configuration errors and prevents certain parts of the system from working correctly."

You have two options:

  1. (Preferred/recommended option) Create separate IIS sites for each app. Live site will be e.g. domain.com and the admin app will be using admin.domain.com domain. If you want your editors to use domain.com/admin to log in, use the admin redirection.

  2. Create two separate virtual apps in the IIS under the web site. One for live site and second for admin app. Then, you will have the URLs like domain.com/site and domain.com/adminapp

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 11, 2023 17:25

While Juraj is correct, I can say we have set up multiple sites as you're explaining without issue. We have not experienced this: "Nesting one of the applications under the other causes configuration errors and prevents certain parts of the system from working correctly."

What it seems you have an issue with is your virtual directory on your main website. In IIS you'd set your site up like so:

Image Text

So your domain would be domain.com/cms/admin to log in. Using simple IIS setup, you'll need that sub-application to get the CMS to run properly under the main MVC site. The only other way around this would be to set this up the same way and add a rewrite in the MVC site

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 12, 2023 05:32

@Brenden - well, it can be run like that but as you can see in the documentation, we do not recommend nor support it. We have seen many issues with this setup and it depends also on the front end app setup - especially what you will set in the web.config file. IIS then usually automatically inherits the web.config settings for the nested apps unless you "remove" or "clear" given settings. This happens mostly when using custom headers and CSPs - which is pretty common these days for security reasons to set the CSPs - and then this breaks the admin app. So, I would definitely not recommend this setup you mentioned. you can make it work, but you need to know what you are doing and how things work...

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 12, 2023 05:36

You are correct Juraj. We have found those issues and resolved them for MVC5 sites. However we don't have any issues with .NET 6 sites at all.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 12, 2023 07:17

Maybe because you know what to do and hot to do it. But I would still play it safe and use separate IIS sites - it is also best practice in general to keep apps separated.

0 votesVote for this answer Mark as a Correct answer

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