The attached patch allows optionally overriding $base_url for purposes of Pathologic's filtration process. The intention is to use pathologic to make sure internal page URLs go to a particular canonical version which may not be based on the global base_url parameter.
This leverages an optional parameter of the url() function to override it's use of the global $base_url. This parameter is marked as being for internal use.
Use Case
- Domain A is public facing, http-only.
- Domain B has SSL support
- Authenticated traffic is only site staff & administrators.
- Redirect all authenticated traffic to Domain B (with path-based multi-site) for security
- Enforce a canonical URL on content created via the "administrative domain" so text render cache is not in a race condition between the use of the two different domains.
I have linked to #2071695: local URLs don't work when Drupal is in a subdirectory as a related issue because of the coincidence that my use case happens to use path-based multisite, but that relates more to the scale on which I am using the functionality requested, not to the functionality itself.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2159503-4-pathologic-canonical_base_url.patch | 1.52 KB | Grayside |
Comments
Comment #1
Grayside CreditAttribution: Grayside commentedComment #3
Grayside CreditAttribution: Grayside commentedThat is an interesting test failure which may explain my problem with #2071695: local URLs don't work when Drupal is in a subdirectory.
Comment #4
Grayside CreditAttribution: Grayside commentedNope, didn't help the other issue. Made adjustments, lets see how the testing stands.
Comment #5
Garrett Albright CreditAttribution: Garrett Albright commentedLooks like this approach will still work for D8 too.
This functionality should be testable. Care to write one? :D