Is it possible for Drupal to handle both subdomain and subpath for a single site in a Drupal multi-site environment?
For example:
foo.example.com ---> 'foo'
example.com/foo ---> 'foo'
Is this possible? Would I run into any issues?
Is it possible for Drupal to handle both subdomain and subpath for a single site in a Drupal multi-site environment?
For example:
foo.example.com ---> 'foo'
example.com/foo ---> 'foo'
Is this possible? Would I run into any issues?
You can configure your desired structure/aliasing by creating the sites.php file in the sites
directory. See the example.sites.php file in the same directory for extensive documentation on this topic.
So, for your use case:
$sites['foo.example.com'] = 'foo';
$sites['example.com.foo'] = 'foo';
When visiting foo.example.com or example.com/foo, Drupal will return the "website" located at sites/foo
. (However, instead of foo usually the name of the (sub)direcotry is one of these aliases).
About running into any issues, the one thing that comes into my mind is that search engines seem to appreciate unique content. It is considered bad practice if your (public) content can be accessed by multiple web addresses (therefore generally it is recommended to set up 301 redirects, however, not sure if this is the right place to discuss this topic since it is not specific to Drupal).
ln -s . foo
– HumanSky
Aug 3 '15 at 12:54