Here is my setup:
A Drupal 8 multisite installation on a subdomain that can be reached with:
http://my.subdomain.be/mysite
If I am logged in as an administrator or with any other available role, everything is fine.
But
If I browse my site as an anonymous user, then the links of the menus doesn't include anymore the "mysite" path.
This is true for all the menus even the "user account menu"
Exemple:
The link to logout is http://my.subdomain.be/mysite/user/logout
when I am logged in (which is fine) but the login link is http://my.subdomain.be/user/login
(which is really bad as "/mysite" is missing)
Of course, all my hand-made links have also this problem.
I don't think it is a setup problem on my side because it is working when logged in (but I could be wrong)
In any case, here are the only changes I have made to htaccess: (uncommenting the following 3 lines)
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/foo will be redirected to http://example.com/foo)
# uncomment the following:
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
RewriteBase /mysite
Here is my very basic apache2 setup:
<VirtualHost *:80>
DocumentRoot /var/www/html/drupal8
ServerName my.subdomain.be
ServerAdmin web-master@subdomain.be
ErrorLog /var/log/apache2/error/error_mysubdomain.log
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
LogLevel error
SetEnvIf Request_URI "\.(jpg|xml|png|gif|ico|js|css|swf|js?.|css?.)$" DontLog
CustomLog /var/log/apache2/access/access_mysubdomain.log combined Env=!DontLog
</VirtualHost>
Some other Apache config for Drupal:
<Directory /var/www/html/drupal8>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Some settings in settings.php:
(I have tried with and without the $base_url)
$base_url='http://my.subdomain.be/mysite';
$settings['trusted_host_patterns'] = array('^my\.subdomain\.be$');
And finally, for now, my sites.php file exists but contains nothing (I have tried with and without settings in it)
Comments
Comment #2
cilefen CreditAttribution: cilefen commentedI just now created a multisite in a subdirectory and I cannot reproduce the problems you have seen. I did not modify the .htaccess or set the $base_url. So, this is likely not critical. I consider it normal until we know it is reproducible.
Comment #3
cilefen CreditAttribution: cilefen commentedComment #4
DuneBLok, thank you for checking this!
If you think it is a good idea, I can provide you access to the site (with devel).
If yes, I can do it beginning of next week (i take few days of vacation)
The only fix I could find is to go in a single site setup...
Comment #6
Ky1eT CreditAttribution: Ky1eT as a volunteer commentedComment #7
thomas73 CreditAttribution: thomas73 as a volunteer commentedI had the same issue, than a 'drush cr' fixed it :o
Comment #14
pameeela CreditAttribution: pameeela commentedThanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.
As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)".
Since there were no specific steps to reproduce the issue provided since the issue was postponed, I'm marking the issue "Closed (cannot reproduce)". If anyone can provide complete steps to reproduce the issue (starting from "Install Drupal core"), document those steps in the issue summary and set the issue status back to "Active".
Thanks!