Tuesday, January 16, 2007

Configuring multiple sites under a common root

When there are several sites under a common root site, For ex, mysite - >mysite/forum - > mysite/blog , where all three are different solutions and each has a separate config file with some common settings. Due to inheritance nature of web.config, the child config gets the attributes of the parent config.

Therefore, if you have the following, both in mysite and mysite/forum without the location tag, then it will surely cause a runtime error ,"Same session cannot be removed twice"

<httpModules>
<remove name="Session"/>
</httpModules>



To solve this, we can use location tag, which is declared right before the system.web tag.

<location path="mysite">
<system.web>
<!-- do things here ->
<system.web>
</location>



By using the location tag, we can ensure that a particular setting will be applied only to mysite, not to mysite/blogs or myiste/forum.

Similarly , we can avoid such scenarios by removing the common blocks in child config, if we dont want to use location tag.

A Reader's Toolbox

Since the advent of affiliate marketing program many companies use to configure multiple sites under common root. It is quite easy for web companies because it provides lot of web space. This option is not available with all hosting providers but you can know this through webhosting reviews. Most of companies are using wireless security for their servers to avoid risks for servers. You should make plans when buying a web name so that you can implement it easily. You can get all information about hosting using phone service. There are many companies that are providing online support for webhosting net.

No comments: