I have a site up and running using Drupal.I use a web-hosting service, that uses Plesk 12 panel.Recently I decided to add a subdomain for the mobile version of my site.So I created a subdomain inside Plesk, pointed it to www.mydomain.com and named it m.mydomain.com.My desktop site is in httpdocs folder and my mobile version in m.mydomain.com folder.Then I added redirection to my mobile site when a mobile device is detected.
The problem is that m.mydomain.com does not show images because they are uploaded in httpdocs/sites/default/files which is my desktop site.Is there a way to access that folder from my subdomain?I have no access to http config files.Is there a way to do this from .htaccess file of my sub-domain?
*UPDATE
My structure is:
root
—–httpdocs
———-desktop site folder
—————–desktop site files
———-mobile site folder
—————–mobile site files
———-images
2
Answers
The best option I can think of is to use the Drupal module Domain Access.
From the module’s page:
Using that, you should be able to apply a different theme to the subdomain site than what you are doing with your main domain. You could use JavaScript or the like to redirect people to the subdomain.
The second option is that there is already a module called Mobile Tools that allow you to change theme and other settings for mobile devices. The description for that module page is as follows:
It was mentioned in this question, “How to redirect users to mobile site“. However, I must caution you against using the Mobile Tools module as it is only in development, and the last contribution to it was 3 years ago. (Plus they have a big warning on their module page that says “Do not use on production”.)
Either of these modules should be able to get you started in the right direction.
Instead of doing a redirect, I would place the images in a folder accessible to both systems. My understanding is right now you have something similar to…
site1/images
site2
If you move your images folder higher in your folder architecture to the same level as site1 and site2 and you update your Public file system path and Private file system path in the media configuration to be that directory it will resolve your issues. Essentially your folders will end up looking like this.
site1/
site2/
images/