Sub-directory domain on subdomain multisite?

I didn’t find an answer on here. But on the net, it’s in German. I thought I share it here, because it is a neat solution.

As suggested I added below cookie constants to the wp-config.php.

define( 'ADMIN_COOKIE_PATH', "https://wordpress.stackexchange.com/" );
define( 'COOKIEPATH', '' );
define( 'SITECOOKIEPATH', '' );

And replaced the content of the .htaccess with:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

After this you can create a new site, with a random subdomain. Because you still can not directly create the new site as sub-directory domain. But you can go to the edit screen of the newly created domain, and there you change the URL to the sub-directory domain you want to have.

So far it works like a charm for me.