Copy link to clipboard
Copied
Hi All -
I am new to this multiple domain thing. Am working on a project, where there multiple domain projects under on webroot. Like www.abc.com, www.def.com under one root. The folder structure is something like below:
E:
webroot
--INCLUDES
--IMAGES
--image.gif
-- www.abc.com
--folder1
--index.cfm
-- www.def.com
So the above two diff domains share two common folders. When I use an include file of form .cfm, I can get it to work. But somehow the images are not displayed. I tried the following syntaxes
Suppose I want to access images from index.cfm under www.abc.com/folder1, i tried the following:
<img src="../../IMAGES/image.gif">(does not work)
<img src="E:/webroot/IMAGES/image.gif) (also does not work. The image symbol is shown but the entire image is not shown).
Any thoughts on how to get this working?
Copy link to clipboard
Copied
Well, first, it might be useful to figure out what exactly you mean by
"webroot" here. Generally, it means the folder that actually maps to a
web server's HTTP root directory. For example, if you have a single
web server that corresponds to a single domain, you might have
something like this:
c:\inetpub\wwwroot\
which maps to
In your above example, does the directory e:\webroot\www.abc.com map
to http://www.abc.com/? If so, the webroot is e:\webroot\www.abc.com,
not e:\webroot.
Assuming that your webroot is e:\webroot\www.abc.com, neither of those
image tags will work. The second won't work no matter what your webroot is,
because a browser isn't going to be able to resolve a directory path
on the server. You'd have to create a virtual directory for each of
those virtual web servers (www.abc.com, www.def.com). Then, you'd be
able to resolve URLs using the virtual directory as your starting
point:
<img src="/images/image.gif">
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Copy link to clipboard
Copied
It would be helpful to know exactly how you are accessing these domains from a web browser.
Examples:
http://www.somedomain.com/www.abc.com/
or
If its the first one, <img src="/images/image.gif"> will work.
If its the second, the IMAGES folder would be below you're "webroot" and would not be accessible no matter what you did. What you could do in this case is create a "Virtual Directory - IIS" or a "SimLink - Linux" linking to the IMAGES folder for each site. So that both sites would have access to the same IMAGES folder.
Copy link to clipboard
Copied
It's probably important to shift your thinking a bit here. Theer are two different "roots" here (well: three, if you're looking at a default IIS install):
* CF root;
* web site root;
* a directory called wwwroot
Looking at your example:
webroot --INCLUDES
--IMAGES
--image.gif
-- www.abc.com
--folder1
--index.cfm
-- www.def.com
webroot (which I am guessing is your C:\inetpub\wwwroot dir) in this case is not your "web root", it's your CF root, by the looks of it. And the directories www.abc.com and www.def.com are your web roots for those two sites.
Confusion often arises here because when one configures CF, the CF root is often mapped to C:\inetpub\wwwroot (or the htdocs dir or whatever the web root is of the web server's default site), so it seems like there's just the one "web root". But there isn't.
So CF will look for resources in the CF root; the web server will look for resources in the web root of the site being served.
In your example, the websites cannot access IMAGES, because that directory is not in the web root of the site. As someone else has suggested, you need to add a virtual directory within the website to map to the IMAGES dir.
You cannot use .. notation to navigate up the file system to "above" the web root, because as far as the web site is concerned, the www.abc.com dir is the ROOT directory. IE: that's as far up the file system the site can access.
The reason why you E:\[etc] path does not work is because that path is requested by the web browser, which is going to be on a completely different computer to where the E: drive is. The path needs to be a URL.
--
Adam