I will admit right off the bat, i am NOT a programmer! But I am not stupid, I can usually figure things out. This, however has me stumped! i have a gig of web space. I have 3 different web URL's I created folder on the gig of space for each URL with an index.html page Each URL is a different web page. readyhosting told me I need to write an index.asp file to tell each website where to go. they gave me the following "example" After trying many many times to get it to work, I find out from readyhosting does not support custom asp files and the above was just an example and that more code is needed... Can anyone help a poor girl out? I have requested books from the library, but books can't tell me what you experienced coders can! Thanks!
thanks what about this code I just found. private void Page_Load(object sender, System.EventArgs e) { if(!IsPostBack) { string url = Request.Url.ToString().ToLower(); string domain; // get just the domain name for the switch if ( url.StartsWith( "http://" ) ) url = url.Substring( 7 ); int x = url.IndexOf( '/' ); if ( x > 0 ) domain = url.Substring( 0, x ); else domain = url; // redirect based on the domain name switch( domain ) { case "www.myfantasticfranchise.com": case "myfantasticfranchise.com": Response.Redirect( "MFF/index.html", true ); return; case "www.metoproductions.com": case "metoproductions.com": Response.Redirect( "MTP/index.html", true ); return; case "www.aayt.tv": case "aayt.tv": Response.Redirect( "AAYT/index.html", true ); return; } // unknown url Response.Write("<h2>You got here (" + domain + ") by error.<br>" ); Response.Write( Request.Url.ToString() + "<br></h2>" );
The second bit of code you posted is asp.net. To get that to work you will need the .net framework. As far as your hosting, does it support ASP? If so then your first example should work if you save the file as default.asp. Most hosts however give you the ability to create multiple domains and they create the folders for you, so it's not just a domain pointer. Check if your host will allow that.
Yeah, you will have to write code to support redirections as ASP does not have support similar to what we get in php thru the .htaccess file.