7

What is the best way to manage the ExpressionEngine themes folder with an MSM setup which includes multiple domains?

Currently, I am copying/mirroring the themes folder across all site folders contained in the MSM setup. This tends to work fairly well as long as I set the 'URL to your "themes" folder' and the 'Theme Folder Path' in the Admin section of the CP for each site accordingly, and remember to copy the update files across all domains each time one is added or updated.

My problem is getting a cross-domain access error with js if one of those steps is forgotten or fails. Is there a better way of managing fieldtypes, extensions, etc. where I could keep everything located near the system files and not get these errors when using MSM?

  • 2
    Could you use symlinks to the same themes folder from the other sites? – Tyssen Nov 20 '12 at 12:08
  • I don't think that would help in the case with cross-domain scripting issues. My guess is that it's due to the Same Origin Policy a la w3.org/Security/wiki/Same_Origin_Policy – W3bGuy Nov 20 '12 at 17:13
  • 1
    I'm no expert on symlinking but I thought there wouldn't be a cross-domain issue because a symlink behaves the same way as if the file was stored in the location you're symlinking from. – Tyssen Nov 20 '12 at 21:14
  • Tyssen is right. He's suggesting another approach to the same idea I'm suggesting. Have different urls for each site, but have them accessing the same content on the server. – UltraBob Nov 20 '12 at 21:56
  • If you've found your answer here it would be good to go in and mark an accepted answer. That will help others having the same issue down the line. – UltraBob Nov 26 '12 at 2:10
3

I keep my themes folder with the primary domain and then for each sub site set the themes path and url to match that. Everything is working fine for me doing it this way. I've got several 2-3 site MSM installs running like this and one 10 site install without any issues.

| improve this answer | |
  • Sean, thanks. I have been running the same without issue, until recently when I saw some of the fieldtypes were acting buggy. After checking the paths, the resolve ended up being moving a copy of the themes folder to each domain due to the scripts inside of them. I hadn't run into this before so I wasn't sure if this was a once-off issue or something I got to look forward to moving forward. Do any of your themes folders contain scripts that would cause this domain authentication issue? – W3bGuy Nov 20 '12 at 17:10
  • not that I'm aware of. Which addons are you using that are resulting in this? – CreateSean Nov 20 '12 at 17:24
  • It sounds to me, based on this new comment, that my answer will solve your issue. Just put a <Directory> directive in each of your vhost configs that point /themes to your one folder. – UltraBob Nov 20 '12 at 21:53
  • Guys... sorry for the delay. I had surgery and was out of pocket then head down lately. I went back over everything and set it back to the way I always ran things in the past and it seems to be okay now. I don't know exactly what the issue was or why it was happening. As always, thanks for the great advice and input. I usually have things set as Sean here and don't have issue either. Regardless, all is well again. ;) – W3bGuy Nov 29 '12 at 22:28
4

This has not been a problem for me, so I'm not 100% sure that this addresses your issue, but I believe you could set up your apache vhosts config (or other web server equivalent) to have the themes folder for all your different domains and sub hosts point to the same actual folder on the server itself. This should avoid any issues with loading up JavaScript from another domain.

| improve this answer | |
  • To follow Tyssen's approach, ssh into your server, remove the extra themes folders, and then run the following command with paths replaced as appropriate: ln -s /path/to/source/folder /path/to/folder/just/deleted – UltraBob Nov 20 '12 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.