Welcome to WebmasterWorld Guest from 22.214.171.124
Forum Moderators: phranque
The overall webspace is referred to by say www.abc.com and there is a folder inside this which is referred to by say www.123.com
abc.com has a folder called photos whose contents can obviously be easily referred to by pages in abc.com using /photos/mypic.jpg
My problem is that I want to refer to images in the photos folder from www.123.com.
I can do it using www.abc.com/photos/mypic.jpg but I'd rather use some form of relative addressing if possible, can this be done?
I am using php if that helps.
Assuming Apache, are you able to modify Apache configuration files, or are you restricted to using .htaccess?
How is one domain being redirected to the other? Using server redirects, via a third-party (registrar, etc.) redirect site (sometimes erroneously called "DNS redirect"), framed redirect, etc?
How you do this is going to depend on the details of your server configuration.
The best way to do this would be to set-up multiple virtual hosts. Disk directories that have content that is in common between sites can be mapped from multiple hosts, using the same or different URL paths.
I'm not using any redirects or framing, their Name Servers point to folders within my webspace.
So, if somebody goes to www.123.com, they are going to see the home page for www.abc.com? Does some PHP code customize the HTML text, so that it shows the appropriate site name? In any case, if you are doing this, the browser's URL bar is going to show the wrong site.
Or is www.123.com a completely separate site with it's own host/hosting plan?
If the former, it's ot a good way to do this at all - you are making do with a hosting plan that really isn't suited for this. It's an SEO nightmare.
If your goal is just to simplify addressing within your documents, you might want to look at the HTML <BASE> tag. This will allow you to reference documents from another part of your site, or even another site altogether, in a relative fashion.
It's rather limited, though, in that it sets a base for all references made from a page.
One way to do this is to use symbolic links in the add-on domains' filespace -- these links make it appear that there is a virtual 'copy' of the shared folders/files in each domain's filespace.
Another way to do it is to use "Aliases" for the shared folder names, but this requires more control over the server configuration than is allowed by most "control panels."
Yes, a symbolic link could do the job, if you have access to a shell login in order to create one.
Otherwise, you can use an .htaccess redirect.