setup SubDomain

Discussion in 'General troubleshooting' started by edkaufmann, Dec 30, 2010.

  1. I try to setup a subdomian using below 'Default.aspx' with an 'asp:Content ...' control. As soon as I add the code ' if (... response.redirect ...' the BUILD brings
    ERROR Message:
    Only Content controls are allowed directly in a content page that contains Content controls.

    What alternative would you suggest to get my SubDomain running?!
    Thanks for your ideas ... and time
    ed

    <%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" ValidateRequest="false" MaintainScrollPositionOnPostback="true" %>

    <% if (Request.ServerVariables["SERVER_NAME"].ToUpper().Contains("SubDomain.MyDomain.org".ToUpper()))
    {
    Response.Redirect("/SubDomain");
    }
    %>

    <%@ MasterType VirtualPath="~/Site.master" %>
    <%@ Register TagPrefix="cc1" Namespace="MyWebPagesStarterKit.Controls" %>
    <asp:Content ID="contentPane" ContentPlaceHolderID="mainContent" Runat="Server">
    <asp:placeHolder runat="server" ID="phSections" EnableViewState="true"></asp:placeHolder>
    <div runat="server" id="divPageSettings" class="sectionsettings">
    <div class="roundedTop"></div>
    <table width="100%">
    <tr>
    <td><asp:DropDownList runat="server" ID="cmbSections"></asp:DropDownList>&nbsp;<asp:Button runat="server" ID="btnNewSection" OnClick="btnNewSection_Click" Text="<%$ Resources:stringsRes, pge_Default_AddSection%>" CausesValidation="false" UseSubmitBehavior="false"/></td>
    </tr>
    </table>
    <div class="roundedBottom"></div>
    </div>
    </asp:Content>
     
  2. Ray

    Ray

    Do you a URL we can look at to see the full error message?
     
  3. Hi Ray,
    I'm pretty sure that I do NOT understand this whole business - so thanks for helping me!

    question:
    in order to setup a subdomain - do I have to have that same name as a subfolder in my root? That's what I did; OR do I need to mess with E:\web\xy

    what I have done so far:
    a) created in CP a SubDomain: 'test.mydomain.org'
    b) created in CP an application starting point: '\test'

    then I uploaded to my subfolder 'test' a very simple WEB site.

    Now using 'www.mydomain.org/test' or 'test.mydomain.org/test' BOTH seem to work correct.

    PS: now when doing the very same thing with my real WEB site ('Myc3') it doesn't work at all!
    error:
    Requested URL http://myc3.mydomain.org:80/myc3/GenericErrorPage.htm?aspxerrorpath=/myc3/default.aspx
    Physical Path E:\web\asgbarba\myc3\GenericErrorPage.htm

    Hope I didn't confuse you more than I am!
    ed
     
  4. Ray

    Ray

    I think the error is misleading because your application is set to throw a custom error when it encounters a problem. The 404 not found error is actually referring to the custom error page it is trying to look for but cannot find it. For now to see the true error message, disable your custom error. Once we see the true error message we can decide on what the next course of action we will need to take.
     
  5. Hi Ray, this is to confusing to me!
    you were right; the error.htm page came in fact from my original (running site). But now I get below error although the indicated page \3edf...... is there!

    Again; when reading my previous msg am I right how I have setup my subdomain? And callling it with 'http:\\myc3.mydomain.org\myc3' ?

    I still think I miss something when setting up this subdomain business!?
    Thanks again ... might be coming back in 2011 will help!
    have a good time
    ed

    Server Error in '/myc3' Application.
    --------------------------------------------------------------------------------

    Could not find file 'E:\web\asgbarba\myc3\App_Data\Pages\3edfc2da-f4e7-4e0a-a934-8b5eb196da01.config'.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.FileNotFoundException: Could not find file 'E:\web\asgbarba\myc3\App_Data\Pages\3edfc2da-f4e7-4e0a-a934-8b5eb196da01.config'.

    Source Error:


    Line 52: //if nothing was found in the cache, the data must be loaded from the disk
    Line 53: //load and deserialize the data from the filesystem
    Line 54: using (FileStream reader = File.Open(_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
    Line 55: {
    Line 56: XmlSerializer serializer = new XmlSerializer(typeof(T));


    Source File: e:\web\asgbarba\Myc3\App_Code\Persistable.cs Line: 54
     
  6. Ray

    Ray

    What is this file 3edfc2da-f4e7-4e0a-a934-8b5eb196da01.config? I've never seen this file before. What is this file suppose to do?
     
  7. well, now we get into the philosphy of my web site (It is based on MWPSK which is a starter kit from MS).
    My 'main' web site (at Winhost) is fully based on it and it uses 'guides.config' for almost all pages - and it works flawless.

    Again I don't want to misuse your time to get into the internals of my web site! All I would like to understand how to setup a Subdomain!

    I'm still not sure whether I did my setup right?

    In CP I defined:
    in Subdomain Manger: myc3.mydomain.org
    in Application starting point: \myc3

    In my 'root' folder I created a folder 'myc3'. Into this 'myc3' folder I loaded my WEBsite (which I want as the subdomain). This is a full blown web site.

    PS: what feels strange to me is the fact that I upload a 'subdomain' into a folder of my root's main site .... ?!?

    thanks for clarifying my confusion
    ed
     
    Last edited by a moderator: Oct 14, 2015
  8. Ray

    Ray

    First off, subdomains by default point back to your root. So if you have a subdomain myc3.mydomain.orgm and you have a domain name mydomain.org both will initially display the same webpage.

    If you want myc3.mydomain.org to open it's own website under a subfolder myc3 then you need to setup a redirect script so that myc3.mydomain.org get redirected to myc3.mydomain.org/myc3/default.aspx. I'm sure you are aware of that and I'm just re-stating it again, but some application gets confused when you setup a redirect script. Applications such as AJAX applications where the initial call has a different address to what you have with your redirect path.

    First things first. I suggest you setup a simple subfolder with a basic ASP.Net web page with "Hello World" and setup a test subdomain and name it to test.mydomain.org and redirect it to a subfolder and to its default.aspx. Make sure you do not make the site complicated, no AJAX. What you want to do is to make sure you redirect script works so that you can get a better understanding of it. Once you are confident it works, then you can start going into your more complicated web applications and diagnose how it is calling it. Meaning do you have AJAX calling an address myc3.mydomain.org, but your redirect script is changing the call to myc3.mydomain.org/myc3. Maybe that is the real cause of the problem you are having and not the actual redirect.
     
  9. Hi Ray, thanks
    all is up and working fine! Even without redirecting i.e I just use eg 'test.mydomain.org/test' .. which is ok for now!
    PS: the file 'not found' obviously had not been uploaded correctly ..

    Thanks again and, hopefully, I don't need to bother you for some time!
    ed
     
  10. Ray

    Ray

    Oh yeah, I guess I over "think" the issue. Most of the time the error "File Not found" actually means just that.
     

Share This Page