Run section under subdomain

Joel Dahlin asked on December 7, 2016 19:23

I have a site, that I want to run /blog under I am able to add a domain alias for that has a default alias path of /blog. loads the /blog page as I hoped. However, subpages under the /blog page do not run under the subdomain as I had hoped. ie. does not load but does load. Is it possible to get the Default Path and all child pages to run under the subdomain?

Recent Answers

Peter M answered on December 7, 2016 21:09 (last edited on December 7, 2016 21:11)

That is correct. You just did the redirect only for the front blog page, but you didn't redirect all the other blog pages. Kentico doesn't know about domains, Kentico cares about paths : and are equal but they are not equal for You either need to add a new alias to existing blog pages so your category page will work with 2 URLs: /categories and /blog/categories (You probably need to pick the main URL and set alias redirect to main URL to avoid duplication). Or sometimes I create a backward compatibility page (with a custom web part) where I capture all old URLs and 301 redirect them to the new ones.

0 votesVote for this answer Mark as a Correct answer

Anton Grekhovodov answered on December 8, 2016 06:01

Hi Joel,

You can create rewrite rules which will rewrite all request from to You can do it in web.config file, example:

<rule name="Rewrite Example">
  <match url="(.*)" />
  <conditions trackAllCaptures="true">
   <add input="{CACHE_URL}" pattern="^(.+)://" />
   <add input="{HTTP_HOST}" pattern="^$" />
  <action type="Rewrite" url="{C:1}://{R:1}" />

or there are some Kentico modules for this purpose:
- Custom 301 Redirect Module
- Custom Redirects Module

Article about URL redirection

0 votesVote for this answer Mark as a Correct answer

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