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

DuneBL created an issue. See original summary.

cilefen’s picture

Priority: Critical » Major

I 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.

cilefen’s picture

Title: Invalid URL when user is not logged in multisite setup » Links are rendered without the subdirectory path for anonymous users on multisites hosted in subdirectories
DuneBL’s picture

ok, 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...

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Ky1eT’s picture

Version: 8.3.x-dev » 8.4.x-dev
Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)
Issue tags: +FLDC17
thomas73’s picture

I had the same issue, than a 'drush cr' fixed it :o

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Issue tags: -FLDC17 +Bug Smash Initiative

Thanks 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!