| |||||||
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
| |||
|
Say x.com and y.com are both hosted on the same Linux VPS. x.com/images stores images to be used on both x.com and y.com. Ideally I would like to to just have one physical copy of the images on x.com and access this from y.com i.e. map or alias y.com/images to x.com/images. From googling around, I see that this is a common thing to want to do and hear mentions of having alias commands in vhost.conf files on Plesk. However, I know little about Plesk and do not have a clue how to proceed. Is it possible to set this up easily on a Blacknight VPS? Otherwise, the only way I can see of achieving this is to reference the full x.com URL on y.com whenever I want to use an image from x.com. As well as thinking that this type of linking must be inefficient, this would also cause me issues as I won't always be sure which images exist on x.com and I don't want to be trying to display images on y.com that don't exist on x.com. On x.com, I can use file_exists() in my PHP script to check the images exist first as they are local files, but I can't do that from y.com, so it all starts getting a bit messy. Any help on this would be appreciated. If I could just get over this one hurdle, it would make getting the sites up and running for both domains very easy. |
| ||||
|
Without thinking too much about this ... Could you use a mod_rewrite rule? ie. map /images to the source?
__________________ Please do not send me PMs for support issues - thanks for your understanding. Blacknight Blog | VPS Hosting| Blacknight Technical Status Blog | Hosting Wiki |Speed Test|Webmaster Chat |Personal Blog |
| |||
|
Thanks for the quick reply on this. I had wondered if htaccess could handle this alright, but if I used rewrite rules, I think I'd still be stuck for checking the images exist on the remote server. Plus, I figured that using rewrite rules would still be the same load server wise as just linking to the remote URLs, but I'm no sys admin so I could well be wrong there! If the "virtual" images directory isn't possible on a Blacknight VPS, I'm thinking I may be best keeping track of the active image URLs in the database and on y.com work out which images exist on x.com based on that. I know that another workaround would be to store the images themselves in the database, but I'd rather not get into that. |
| ||||
|
Hmmm I'm not sure which is the best way to do it, but I'll see if I can get one of our sysadmins to look at this thread and possibly suggest a solution
__________________ Please do not send me PMs for support issues - thanks for your understanding. Blacknight Blog | VPS Hosting| Blacknight Technical Status Blog | Hosting Wiki |Speed Test|Webmaster Chat |Personal Blog |
| |||
|
how about the liunx command ln -s , for a symbolic link How to: Linux / UNIX create soft link with ln command |
| |||
|
I've got my symlink set up, but am getting 403 errors when I try to access URLs under the symlink. After chatting online with support, I've sent in a ticket for further investigation. Fingers crossed it can be sorted! ![]() Thanks again, Janine. |
| |||
|
Googled and found a fix for my 403 permissions error: adding the following line to the htaccess file on the domain with the symlink: Options +FollowSymLinks It's great to have this working, but I'm just wondering if there's any downside to turning this on in htaccess? Thanks, Janine. |