Print Page | Close Window

subdomain?

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=24253
Printed Date: 28 March 2026 at 11:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: subdomain?
Posted By: codeguru
Subject: subdomain?
Date Posted: 23 August 2007 at 10:57am
Is there any way to access an include file in the main domain from a subdomain? Please help.

-------------
www.coderewind.com
Best Place to hunt for Code



Replies:
Posted By: Scotty32
Date Posted: 23 August 2007 at 8:52pm
it depends on your hosting account.

if the subdomain has access  to the main domain name files then yes, if not then no.

you can try by finding out if you have access add the following to a page on both the sub domain name and main domain name.

<%=Server.MapPath()%>


this with give you your physical location on the server

as an example i will use the following as a file structure

/www/domain.com/
/www/sub.domain.com/

using the above as an example you would use the following code to include a file from "domain.com" in "sub.domain.com", this will be in a page on the root of sub.domain.com

<!--#include file="../domain.com/include.asp"-->


the "../" means go back a folder, so if its in a subfolder on "sub.domain.com" add two, or how ever many you need


-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: codeguru
Date Posted: 08 September 2007 at 11:55am
Thanks for the help

-------------
www.coderewind.com
Best Place to hunt for Code



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