Print Page | Close Window

sub domain problem

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=23927
Printed Date: 29 March 2026 at 8:32am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: sub domain problem
Posted By: Dxlwebs
Subject: sub domain problem
Date Posted: 24 July 2007 at 7:10pm
hello i wish to make sub domains and i have the forum working under forum.host.c and i have my home.asp directed to my main domain name but i cannot get the main domain to get the home.asp page it just gets the forums default.asp all the time does anyone know what codes i need to do this p.s. im using brinkster

if any one can help me quickly my email is masterdxl@hotmail.co.uk


-------------
DxL - Design Is Everything



Replies:
Posted By: KCWebMonkey
Date Posted: 24 July 2007 at 10:17pm
you would have to check with your hosting account and it's control panel.


Posted By: Dxlwebs
Date Posted: 25 July 2007 at 6:23am
i checked with them and because its a sheared hosting i was given a code to use but its not very good it would be great if someone could help me out this is the code i was given
<%@Language=VBScript%>

<%

SiteNameURL = Request.ServerVariables("SERVER_NAME")



Select Case SiteNameURL

Case "yourdomain.com"

Response.Redirect "page1.asp"



Case "www.yourdomain.com"

Response.Redirect "page1.asp"



Case "yourotherdomain.com"

Response.Redirect "page2.asp"



Case "www.yourotherdomain.com"

Response.Redirect "page2.asp"



Case "subdomain1.yourdomain.com"

Response.Redirect "page3.asp"



Case "subdomain2.yourdomain.com"

Response.Redirect "page4.asp"



Case Else 'redirecting everything other than cases selected above

Response.Redirect "other.asp"

End Select

%>



-------------
DxL - Design Is Everything


Posted By: WebWiz-Bruce
Date Posted: 25 July 2007 at 7:42am
Looks like your host doesn't actually support subdomains so have given a dodgy workaround, which never works how it's intended.

If you want to use sub domains change web host, plenty of shared web hosts give you sub domains, like with our own hosting packages, checkout http://www.webwiz.net/webhosting/ - www.webwiz.net/webhosting/


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Dxlwebs
Date Posted: 25 July 2007 at 9:15am
is there any way i can direct to the sub domain with out changing the name of the forums default.asp name because the code says it must be named default.asp or index.asp and index.asp does not work and the forum uses default.asp so im stuck 

-------------
DxL - Design Is Everything


Posted By: Dxlwebs
Date Posted: 25 July 2007 at 9:56am
The Way it should be done Durh to my self!!!

instead of using asp coding that is useless by the way you need to creat a file called default.htm not asp htm people and them put this code in there!

<html>

<head>

<title>Redirect Script with JavaScript</title>

<script language=javascript>

var whois=location+" "



if (whois.indexOf("domain.com") != -1)

          { window.location ="home.asp" }



if (whois.indexOf("www.domain.com") != -1)

          { window.location ="home.asp" }



if (whois.indexOf("yourotherdomain.com") != -1)

          { window.location ="page2.html" }



if (whois.indexOf("www.yourotherdomain.com") != -1)

          { window.location ="page2.html" }



if (whois.indexOf("forum.domain.com") != -1)

          { window.location ="/forum/" }



if (whois.indexOf("subdomain2.yourdomain.com") != -1)

          { window.location ="page4.html" }



</script>

</head>

<body>

</body>

</html>

And Gues What it really works woooow lol so for anyone having the same problems as i was there is the solution in a nutshell



-------------
DxL - Design Is Everything


Posted By: WebWiz-Bruce
Date Posted: 25 July 2007 at 9:58am
The way they have given you do it is a bad hack. It's not a sub domain at all, all this simply does is allow you to use a different domain name to your site and then redirect to a different folder or page on your site. You still end up with the URL pointing to the folder that you place the forum in.

If this is the only solution your host can give and won't set you up a sub domain, which can be done on shared hosting as we offer these, then I would just forget about using a subdomain and just place the forum in a folder on your site as this hack isn't really going to give you what you want and is error prone and isn't very search engine friendly.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Dxlwebs
Date Posted: 25 July 2007 at 10:40am
hmm well i had a big argument with them and they are adiment that it is the way to do it and i do have a sub domain but im no profesional so i wouldnt realy know i thought that the subdomain would give me another folder to put the other stuff in but that never happened lol if your right then i should talk to them again. what do you think?

-------------
DxL - Design Is Everything


Posted By: WebWiz-Bruce
Date Posted: 25 July 2007 at 11:09am
This isn't a sub domain at all they are simply setting the sub domain name you are giving them up as a domain alias.

How a sub domain should work:-

Example sub domain name: forum.webwiz.net

You would setup forum.webwiz.net as a web site in IIS, and point it to a folder on the server (this could be a folder inside a present web site).
Then when someone types in forum.webwiz.net IIS grabs the pages from the correct location on the server.

Many web hosts don't like sub domains as they have their own application and function as another web site and so use as many resources as a full blown web site.

What your host is doing is simply setting up forum.webwiz.net as an aliases to your main site which means IIS simply routes any requests to forum.webwiz.net to your present site. They have then given you a coding hack that gets the web site header and redirects to a part of your present site, giving an impression of a sub domain without it actually being a sub domain.

This is a trick used by cheap web hosts, and if they are advertising this as sub domains you should demand that they set you up a sub domain, not a domain alias, as this is a very low and underhand trick.

In the web hosting game it is often as the saying goes, 'you get what you pay for' cheap web hosts may look attractive, but you often don't get what it says on the tin.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net