Hi, I'm trying to do a different 'files' folder on my two multisites.

I want this:

sites/my_domain1.com/ -------> themes
---------------------------------------> files <--- ***
---------------------------------------> modules
---------------------------------------> tmp

sites/my_domain2.com/ -------> themes
---------------------------------------> files <--- ***
---------------------------------------> modules
---------------------------------------> tmp

I was reading Setup of /sites directory for multi-site but it doesn't work on Drupal 4.7.x (or it doesn't work on my drupal 4.7.x webpage). .. On that page appears a special code for do this:

<?php
$conf = array(
  'file_directory_path' => str_replace(dirname($_SERVER ['DOCUMENT_ROOT']).'/','',dirname(__FILE__)).'/files'
);
?>

If I insert it on the settings.php of both multisites there appears the next error when I try to upload a file (image, audio..): "The selected file /tmp/tmp_CqsjhC could not be uploaded, because the destination image1.gif is not properly configured."... and the image is not on the sites/domain1.com/files/ directory :-(

Main doubt:

Does I need to write on "administer" > "site configuration" > "file system" the path: sites/domain1.com/files and sites/domain2.com/files (for my second multisite)?

---> If yes... all users will know I'm using multisites because they will see the full large path of the 'files' folder, and for this we don't need to insert this code on the settngs.php, do we?

---> If not... How should I solve this? Could someone explain me this, please?

Thanks for reading.

Comments

mfer’s picture

the simple answer is to setup the files directory to be in the /sites/example.com/files directory. Yes, people will see you are doing it via a multi-site setup. Are you trying to hide that?

--
Matt
http://www.mattfarina.com

joancatala’s picture

Hi Matt, thanks for your reply...
I wrote this because I would like to upload the "image10.jpg" on my http://domain1.com/files/image10.jpg and no on the long path http://domain1.com/sites/domain1.com/files/image10.jpg ... do you understand? is it posible?

thanks in advance,
joan

mfer’s picture

I think you can do this with some custom written .htaccess rules.

--
Matt
http://www.mattfarina.com

Dubber Dan’s picture

If that's the case does anyone know what the custom rules are?

Also, it would seem to make sense that if multisite installs are built in to Drupal (and I'm really pleased that they are) why oh why isn't this included too? That said, the multisite setup does need to be tidied up. Only got it working after much searching the forums and posting a couple of questions...

venkat-rk’s picture

Did anyone work out the method to avoid the long name in file paths for sites running a multisite drupal install?

Thanks,
Venkat

----
Previously user Ramdak.

gpk’s picture

I can see 2 options:

1. (Easier, not so pretty)
If you are on a liunx server, you could do something like set up symlinks from files/1 and files/2 to sites/domain1.com/files and sites/domain2.com/files (or you could call the symlinks files1 and files2)

2. (Harder, the cleaner way)
Write .htaccess rules that basically do this:
IF domain1.com
AND IF requesting URI files/*
THEN instead internally redirect to sites/domain1.com/files/
Have a hunt around here or on the web for examples. Sorry I don't have time right now to dig same out for you!

Best,
gpk
----
www.gelst.com

venkat-rk’s picture

Hi,

Thanks a bunch for these two options. I think the .htaccess will be a better solution. Should be possible to get it working.

----
Previously user Ramdak.

Dubber Dan’s picture

Anyone managed to find a solution to this as I'd love to get it working more smoothly?

venkat-rk’s picture

You may want to look at http://drupal.org/node/165195 for a similar discussion and for cog.rusty's excellent explanation of the whole thing.

----
Previously user Ramdak.

Dubber Dan’s picture

Much abliged :-)