Main Site and SubDirectory with different site (same project)

Discussion in 'Domain names / DNS' started by Senor Engineer, Mar 1, 2015.

  1. Hello,

    Here is my plan. I created sub-directory in code diffsubdir (different sub directory for new site), that will have test.aspx (\\diffsubdir\test.aspx) for a different website - diffsite.com, already registered using domain pointer (let's call main site as mainsite.com).

    When there is a request coming from diffsite.com, I would like to show \\diffsubdir\test.aspx (I'm using same application code for mainsite.com with same web.config, calls same database for both the sites, all I need to show \\diffsubdir\test.aspx for diffsite.com, using common web.config). Can you please direct me how?
     
  2. Any help that I can get here?

    Can you provide ideas if I can have same web.config in one project - root will be one site, and subdirectory can be another site?

    Or, if the above is not possible, I can create a separate project and place the code in different directories as well.

    +Folder-Website1
    - Web.Config (website1)
    +Folder-Website2
    - Web.Config (website2)

    If so main account will be pointed to +Folder-Website1, how do I change to the additional domian pointer to +Folder-Website2 ?
     
  3. mjp

    mjp

    Check out the KB article, How to redirect a subdomain to a subdirectory.

    Subdirectories inherit web.config settings, so web.config settings in the root directory will apply to subdirectories. You can also have a separate web.config in a subdirectory, but that inheritance from the root will override the subdirectory web.config. Meaning if your root web.config and your subdirectory web.config have different settings for the same thing, the settings in the root will override.
     
  4. Thanks for the response mjp,

    I'm not looking for subdomain. Two domains are totally different, but I want to use only subdirectory.

    Two domains I have for two different sites (I purcased domain pointer for 2nd one, trying to get the site active):

    www.domainname1.com
    www.domainname2.com

    Let's say domanname1 is as follows

    folder1
    folder2
    .
    .
    web.config

    Now, I want to point my new code (new project code with separate web.config) - code is in folder-new for example. So the URL Rewrite instructions to be written for root web.config? Can I get the instructions link on different domain (not subdomain) use the subdirectory) ?

    folder1
    folder2
    folder-new
    - folder-new1
    - folder-new2
    - Web.config
    .
    .
    Web.config
     

Share This Page