Drupal 8 multisite install where
- First site is on a subdomain one.example.com
- Second site is in a subfolder one.example.com/two
How can files folder for both sites to be accessible via URL/files and not URL/sites/domain/files
- current: one.example.com/sites/one.example.com/files
- desired: one.example.com/files
- current: one.example.com/two/sites/two/files
- desired: one.example.com/two/files
I tried several variants listed here https://www.drupal.org/node/53705 and put them at following locations, but nothing worked.
- Drupal8/.htaccess
- Drupal8/files/.htaccess
- Drupal8/sites/two/files/.htaccess
Setup information is provided below
Filesystem setup
--Drupal8
--index.php
--one.example.com (sym link ln -s . one.example.com)
--two (sym link ln -s . two) Not required in D8, but could not get the subfolder site to work without it.
--sites
--default (sym links to one.example.com)
--one.example.com
--settings.php, services.yml
--files, modules,etc
--two
--settings.php, services.yml
--files, modules,etc
Sites.php
$sites = [];
$sites['one.example.com'] = 'one.example.com';
$sites['one.example.com.two'] = 'two';
Apache setup : One virtual host for one.example.com
RewriteRule ^files/(.*)$ /sites/%{HTTP_HOST}/files/$1 [L, R] and RewriteRule ^(.*)$ /sites/%{HTTP_HOST}/files/$1 [L, R]
Which .htaccess file are you adding this to?RewriteCond %{HTTP_HOST} ^one\.example\.com$ [NC] RewriteRule ^files/(.*)$ sites/one.example.com/files/$1 [NC,L]
this did not work