webent Posted June 29, 2008 Share Posted June 29, 2008 Hi, I had someone helping me on this little project, but I haven't back from them in a few days, so I was wondering if someone could help me pick back up where it was left off... Let me start by explaining what I want to accomplish,... I have a server, that has a master domain and several other domains... all of these other domains need to get their images from the master domain and they are being called via ssl... So I was told that I could use .htaccess and SymLinks to accomplish this quite easily... but I've Googled by behind off and haven't found anything near what I'm trying... So, here's what I was told to do... If you can make use of .htaccess for your domains, then create a .htaccess for each one with this option: Options +FollowSymLinks (Case is important) and then do this inside the documentroot for the website: ln -s /where/my/master/image/directory/is dir_name_for_images/ For example: cd /var/www/cartplace.com/ ln -s /usr/local/cart/common_images images/ Now, when you go to www.cartplace.com/images/ you'll be able to directly access the master image directory. And here was my response... Ok, wow, I think you lost me... LOL... So, I created an .htaccess, put in the line, "Options +FollowSymLinks", uploaded it to the public_html directory of the secondary domain... Then logged into the server via ssh as root and typed "ln -s /home/maindomain/public_html/supplier/images" But from here I'm a bit lost... Did I do everything right so far? Can someone please help me from this point? Thank you in advance for any assistance you may be able to provide. Quote Link to comment Share on other sites More sharing options...
trq Posted June 29, 2008 Share Posted June 29, 2008 Its pretty self explanitory really. ln (thats LN) takes two arguments, the directory you wish to link to, and the name of the link. So, if you has two sites /var/www/site1 & /var/www/site2 and you wanted to link the images directory from site1 into site2 you would.... cd /var/www/site2 ln -s /var/www/site1/images images/ Quote Link to comment Share on other sites More sharing options...
webent Posted June 29, 2008 Author Share Posted June 29, 2008 Yes, actually you make it sound very simple, thank you... I really do appreciate it... and I did just what you said... but it's not working... I'll explain what I did... cd /home/seconddomain/public_html/shoppingcart ln -s /home/maindomain/public_html/shoppingcart/images images/ It took without any errors... Then I went to "http://maindomain.com/shoppingcart/images/image001.jpg" and the image shows as it should, so then I go to the secondary domain, "http://seconddomain.com/shoppingcart/images/image001.jpg" and it doesn't show up... Did I do something wrong again? Quote Link to comment Share on other sites More sharing options...
trq Posted June 29, 2008 Share Posted June 29, 2008 Can I see the ouput of.... ls -l /home/maindomain/public_html/shoppingcart (they are both L's) Quote Link to comment Share on other sites More sharing options...
webent Posted June 29, 2008 Author Share Posted June 29, 2008 I sent the data to your personal message... Quote Link to comment Share on other sites More sharing options...
webent Posted June 29, 2008 Author Share Posted June 29, 2008 Ok, this all worked actually, its just that I had an images directory already in the secondary domain,... So, Thorpe pointed out, by removing or renaming the images directory and then leaving off the trailing slash at the end of the line, it created an images directory for me with the SymLink in it... Example: cd /home/seconddomain/public_html/shoppingcart ln -s /home/maindomain/public_html/shoppingcart/images images Yes, actually you make it sound very simple, thank you... I really do appreciate it... and I did just what you said... but it's not working... I'll explain what I did... cd /home/seconddomain/public_html/shoppingcart ln -s /home/maindomain/public_html/shoppingcart/images images/ It took without any errors... Then I went to "http://maindomain.com/shoppingcart/images/image001.jpg" and the image shows as it should, so then I go to the secondary domain, "http://seconddomain.com/shoppingcart/images/image001.jpg" and it doesn't show up... Did I do something wrong again? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.