For example, you have to create 3 Web sites:
-mysite.com – the main Web Site
-blogs.mysite.com – for Blogs
-forums.mysite.com – for Forums
The three sites will share same resources, and you want to use single sign-in to manage their contents.
The Site Map will have the following pages:
-Home
-About
-Blogs
- Posts
-Forums
- Posts
Without mapping, the blogs' posts will be accessible with:
mysite.com/blogs/posts.aspx
and the forums' posts with:
mysite.com/forums/posts.aspx
After applying the following domain mapping in the web.config:
| <cms defaultProvider="Sitefinity" ...> |
| <urlMappings> |
| <add key="blogs.mysite.com" value="blogs" shared="true" /> |
| <add key="forums.mysite.com" value="forums" shared="false" /> |
| </urlMappings> |
|
.. when the Web Site is accessed via blogs.mysite.com, it will be opened starting from the blogs page. However, the blogs page will be still accessible through the other domains, because its shared attribute is set to True.
The forums page will be accessible only through forums.mysite.com.
Testing:
You can test it in your localhost before going to production. In order to do this you should edit <path_to_windows>\System32\drivers\etc\hosts file by adding the domains you want to test:
| 127.0.0.1 localhost |
| ::1 localhost |
| |
| 127.0.0.1 blogs.mysite.com |
| 127.0.0.1 forums.mysite.com |
Don't forget to rollback your changes after finishing with the tests.
The "Domain - Page mapping" is the default implementation of the CmsUrlMappingService. However, it is easy to build a custom mapping, based on the current HttpContext like "User - Page mapping" or "Cookie - Page mapping", which defines different SiteMap roots for specific users or for specific value in the cookie. How to do this will be handled in another KB.