Forum Moderators: phranque

Message Too Old, No Replies

Help with folder sharing

Help with folder sharing

         

christianpatrick

10:00 pm on Nov 15, 2010 (gmt 0)

10+ Year Member



Below is a scenario of which I do not know the best way to achieve. Thanks for the help!

I have two domains on the same server of which will have separate directory roots. However, I want the first domain to have a folder that will be shared for the second domain.

Example:

firstdomain.tld/sharedfolder
(This domain would hold the contents of this folder)

seconddomain.tld/sharedfolder
(This domain would link/shortcut to the first's domain folder)

Thanks again for any help on this matter.

wilderness

10:49 pm on Nov 15, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A similar question was just answered a few days ago and remains active in the 1st page threads.

How to direct domains to subfolders using htaccess [webmasterworld.com]

christianpatrick

11:14 pm on Nov 15, 2010 (gmt 0)

10+ Year Member



Thanks for the quick reply. I had, however, already looked into that post. The difference with my case is that the two domains need separate /htdocs but they would share a couple folders.

jdMorgan

3:04 pm on Nov 16, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have server config file access (as implied by your mention of defining the /htdocs path), look into the Apache Alias directive (in mod_Alias) and also into the "symbolic links" feature of the *nix filesystem. Using mod_alias would be preferred in the case where you might later wish (or be required) to change from a server running on *nix to one running on Widows (which does not support symlinks), so it is a more future-proof solution.

Also be aware that if you use a 'control panel' to define the add-on domain and its filespace, it is typically not possible for the add-on and main domains to share file resources; Often, a better approach is to use an IP-based shared server instead of a name-based shared server, set up the DNS to point both domains to the same IP address, and then use the server config file and/or .htaccess to "map" the client-requested hostnames to the appropriate filespace within the server. This allows for some URL-paths to be mapped to 'separate' filespace, while others are mapped to 'shared' filespace. IP-based shared servers are often offered for a minimal additional fee as having a "unique" or "private" IP address. Here in the U.S., I pay $1.00 a month per server to get a unique IP address for all of my sites. While I do not often host multiple sites on these servers, I do use these unique IP addresses to allow me to add subdomains (e.g. for mobile and forum sub-sites) at will.

Jim