Feature #53080

Support for multiple domains

Added by Bastian Waidelich over 8 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
MVC - Routing
Target version:
-
Start date:
2013-10-23
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

Currently the Flow does not support multi-domain setups out of the box:

  • There is no concept of "domains" in Flow yet
  • The Routing Framework only uses a combination of the (hashed) Request path and method as cache identifier for incoming routes
  • How should linking to other domains than the current work? Probably the UriBuilder (and thus all uri/link-ViewHelpers need some "domain" argument)

Approaches

Like done with the filterable request methods (#27117) we could add a new routing configuration:

-
  uriPattern: 'some/uri/pattern'
  defaults:
    '@package': 'TYPO3.Flow'
  domain:        'somedomain.tld'

But I wonder: Should this support multiple domains? or some regex-/placeholder-syntax?
Besides I'm struggling a bit with adding to many configuration options.. We'll soon need yet another one for the protocol (#44891).

A more generic approach (like I started with https://review.typo3.org/#/c/19742/) would be very flexible. But it has a bad impact on performance because all "filters" can change the caching identifier..

Get basic multi-domain support today

You can get multi-domain Routing working by creating a custom RoutePartHandler that only matches/resolves when the domain is one of the configured. But then you have to disable the Routing Cache in Caches.yaml::

Flow_Mvc_Routing_FindMatchResults:
  backend: TYPO3\Flow\Cache\Backend\NullBackend
Flow_Mvc_Routing_Resolve:
  backend: TYPO3\Flow\Cache\Backend\NullBackend

NOTE: You should only do so if you absolutely know what you're doing. Disabling the Routing Cache can have a really bad impact on the performance.

Another way to get basic support for multiple domains is to use a (sub)context for each domain (Configuration/Production/Domain1/Routes.yaml, Configuration/Production/Domain2/Routes.yaml). But this won't solve the cross-domain-linking issue.


Related issues

Related to TYPO3.Flow - Bug #54632: route caching should take hostnames into accountResolvedKerstin Huppenbauer2013-12-29

Actions
Related to TYPO3.Flow - Feature #44891: Routes should be able to enforce http/https protocolNew2013-01-28

Actions

Also available in: Atom PDF