PDA

View Full Version : Sub-Domain help


nitro81nj
06-13-2007, 05:44 AM
I purchased sub-domain services from DASP.net, but they give me a script w/ minimal directions. I need to know more indepth directions and where do I input this script. TYVM everyone for your help! :)

nitro81nj
06-14-2007, 02:15 AM
Thank you so much for your help. Here is the script and directions they gave me. I don't know what exactly to input into the script to mAke it run. Can some give a more indepth instructions and examples?


Redirect a subdomain to a subdirectory






The information in this article applies to:

Subdomain





DETAILS


You can redirecta subdomain to a subdirectory by usingASP or ASP.net code.


When the requests are redirected using anASP file, the URL in browser for redirected domains will show the correct domain name and the directory name where the request is being redirected. You can also redirect the requests to a specific file.


For example :


http://subdomain1.YourHostedDomainName.com --> http://subdomain1.YourHostedDomainName.com/subdomain1
http://subdomain2.YourHostedDomainName.com --> http://subdomain2.YourHostedDomainName.com/subdomain2
http://subdomain3.YourHostedDomainName.com --> http://subdomain3.YourHostedDomainName.com/subdomain3/home.asp


The following is a sample script that you can use to redirect a subdomain. You will need to place it as default document on your document root.










<%
If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("subdomain1.YourHostedDomainName.com") ) > 0 Then
Response.Redirect("/subdomain1")
ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("subdomain2.YourHostedDomainName.com") ) > 0 Then
Response.Redirect("/subdomain2")
ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("subdomain3.YourHostedDomainName.com") ) > 0 Then
Response.Redirect("/subdomain3/home.asp")
End If
%>










NOTE:
1. Replace subdomain#.YourHostedDomainName.com with your actual subdomain URL.
2. Replace /subdomain# with your actual subdirectory name
3. In the last redirection statement in the example, we show how to redirect to a specific file

nitro81nj
06-14-2007, 05:31 AM
TYVM how do I use the script to redirect to a specific .asp file on my server?

vvsharma
06-14-2007, 06:23 AM
If the asp page under question is within a subfolder eg. (mypage.asp is within sub-folder blue) then

Response.Redirect('/blue/mypage.asp') and similarly others.

If the page is in the root itself,then it will be

Response.Redirect('mypage.asp') .Its just the path that will change according to where you want it to re-direct.

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)

nitro81nj
06-14-2007, 07:25 AM
I tried everything you told me.....still no luck...

nitro81nj
06-14-2007, 07:34 AM
this is what I enter under my index.asp





<html>
<head>
<title>A New Beginning INC</title>
<script language="javascript" type="text/javascript" src="script.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<style type="text/css">



<%
InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("aisforum.mydomain.com") ) >
Response.Redirect("ais/forum/default.asp")
%>

raymondp
06-14-2007, 09:37 AM
You will need to insure that you update UCase('aisforum.mydomain.com') ) to be your domain name. As an example if discountasp incorporates a redirect it will read

UCase('aisforum.discountasp.net') )

vvsharma
06-14-2007, 09:58 AM
The script is just used for redirecting the user to a sub-directory on your site.

<%
If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("subdomain1.YourHostedDomainName.com") ) > 0 Then
Response.Redirect("/subdomain1")
ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("subdomain2.YourHostedDomainName.com") ) > 0 Then
Response.Redirect("/subdomain2")
ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("subdomain3.YourHostedDomainName.com") ) > 0 Then
Response.Redirect("/subdomain3/home.asp")
End If
%>

Place the above code in your default asp page within the root of your site.What it does is ,checks the requested servername and redirects the user accordingly.
For Eg,
Lets say your domain name is www.abcd.com (http://www.abcd.com) and your sub-domains are 'red.abcd.com' and 'blue.abcd.com'

<%
If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("red.abcd.com") ) > 0 Then
Response.Redirect("/red")
ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("blue.abcd.com") ) > 0 Then
Response.Redirect("/blue")
%>

where blue and red are my sub-folders and the above is placed in my default page in the root (lets say default.asp)



Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)

nitro81nj
06-14-2007, 11:19 AM
I'm getting this error now:





Microsoft VBScript compilation error '800a0414'


Cannot use parentheses when calling a Sub


/index.asp, line 10 InStr ( UCase(Request.ServerVariables("SERVER_NAME")), UCase("aisforum.anewbeginninginc.com")) >
-----------------------------------------------------------------------------------------------^

raymondp
06-14-2007, 12:43 PM
The script will go on top of your startup page that is directly under your webroot. I'm not sure what your startup page is, however it usually is default.asp or index.asp.

raymondp
06-15-2007, 12:01 PM
Try inputting this in your code

<%

If InStr( UCase(Request.ServerVariables('SERVER_NAME')), UCase('aisforum.mydomain.com') ) > 0 then
Response.Redirect('ais/forum/default.asp')
End If

%>

nitro81nj
06-15-2007, 12:36 PM
EVERYTHING I try I get the following when I test the sub domain at aisforum.anewbeginninginc.com:










Web Page Unavailable

We're sorry, the web page you are trying to reach is unavailable.

Please contact the website administrator.

We apologize for the inconvenience.

raymondp
06-17-2007, 01:00 AM
Can you show us your redirect script again.

I have also checked the whois record and your domain is not resolving to our DNS server. So after pinging your domain it is not resolving to the correct IP address. If you are going to host your own DNS server, log into your DASP control panel and under DNS manager review your A record. You will need to insure that your A record on your DNS server matches that on our server.

nitro81nj
06-17-2007, 01:31 AM
What?? Be specific please....what are you talking about?? Step-by-step. The A Record I put in the DNS manager the subdomain to that specific IP to your server. (ie. aisforum.anewbeginninginc.com to the same IPas www.anewbeginninginc.com (http://www.anewbeginninginc.com))

nitro81nj
06-17-2007, 01:40 AM
my redirect script is at the top of my index.asp file and I'm trying to direct to a file at webroot/ais/forum/default.ap

<%
If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("aisforum.anewbeginninginc.com") ) > 0 Then
Response.Redirect("/ais/forum/default.ap")
End If
%>

Post Edited (nitro81nj) : 6/17/2007 1:48:16 AM GMT

bruce
06-17-2007, 08:01 AM
Your script has no problem. The reason why it doesn't work is because the DNS is wrongly set. It looks like you are running your own DNS and the DNS is not properly configured.

If you are not too familiar with DNS, I recommend you update your domain's DNS to point to our server.



Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

nitro81nj
06-17-2007, 10:40 AM
Okay I now pointed the DNS of networksolutions.com (who host my domain) to your server. I still am getting the same error when I tried to go to the aisforum.Anewbeginninginc.com :
<CENTER>













Web Page Unavailable

We're sorry, the web page you are trying to reach is unavailable.

Please contact the website administrator.

We apologize for the inconvenience.


</CENTER>


Now, what do I try to fix this problem??This is starting to getting annoying. I am paying five dollars more month for what? This should not be so difficult to do!

Eric
06-18-2007, 05:52 AM
Well, DNS updates are not instant. It takes about 2-3 days for the update to propogate through the Internet. Please review this knowledge base article on DNS caching: http://kb.discountasp.net/article.aspx?id=10155

We understand that getting a site functional can be frustrating, but we have only been trying to help here. We are not responsible for improperly set DNS, as only the domain owner can set their DNS.

Eric
DiscountASP.NET
http://www.DiscountASP.NET

blammer
08-29-2007, 09:26 AM
I am having a similar problem. I am trying to transition my website over to Discountasp from another host/isp and before making the big leap I want to see it running. I have set up a CNAME Alias with my current website host/isp/asp using the url for my default Discountasp account. I do get an error page though that is the same as the previous postings. Can someone confirm the error page here is coming from discountasp: http://www2.ships2day.com/ (http://www2.ships2day.com/)





If so, then I must just have to tweak my environment to get it going.





-blammer

vvsharma
08-30-2007, 02:15 AM
Unless you dont have a unique IP for your default site,DASP system will not recognize http://www2.ships2day.com/ with the CNAME alias.

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)

blammer
08-30-2007, 04:06 AM
Just to clarify,you're saying I wouldneed a unique/dedicated IP Address for my DASP Default Domain ? Is this an option/upgrade?

I chose the CNAME option because all of the documentation I could find indicated that I could enter a domain as an Alias irrespective of an IP Address. Is there an approach you can suggest to someone that is trying to make a smooth transition of theirwebsitefrom a direct competitor of yours?

-blammer

vvsharma
08-30-2007, 08:19 AM
Another direct option would be to have your domain DNS records point toDASP name servers,But if you want to use sub-domains other than 'www','ftp' etc ,you will need a unique IP.

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)

adventmedia
08-12-2008, 07:52 AM
We have a unique IP with DASP and I have created the cName test.example.com - How do I FTP into this subdomain? Do I have to create a separate Filezilla site address as test.example.com instead of ftp.example.com?

Aristotle
08-15-2008, 06:05 AM
mASSmed;a said...
We have a unique IP with DASP and I have created the cName test.example.com - How do I FTP into this subdomain? Do I have to create a separate Filezilla site address as test.example.com instead of ftp.example.com?Since all subdomains point to the root, it doesn't really matter.

Just to make things clear...
http://test.example.com does not equal http://www.example.com/test
http://test.example.com equals http://www.example.com




Aristotle

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)