CanonicalURLMiddleware
class CanonicalURLMiddleware implements HTTPMiddleware
Implements the following URL normalisation rules - redirect basic auth requests to HTTPS - force WWW, redirect to the subdomain "www." - force SSL, redirect to https
Traits
Methods
An implementation of the factory method, allows you to create an instance of a class
Creates a class instance by the "singleton" design pattern.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Handles redirection to canonical urls outside of the main middleware chain using HTTPResponseException.
No description
No description
Get enabled flag, or list of environments to enable in.
Set enabled flag, or list of environments to enable in.
Details
in Injectable at line 26
static Injectable
create(array $args)
An implementation of the factory method, allows you to create an instance of a class
This method will defer class substitution to the Injector API, which can be customised via the Config API to declare substitution classes.
This can be called in one of two ways - either calling via the class directly, or calling on Object and passing the class name as the first parameter. The following are equivalent: $list = DataList::create('SiteTree'); $list = SiteTree::get();
in Injectable at line 43
static Injectable
singleton(string $class = null)
Creates a class instance by the "singleton" design pattern.
It will always return the same instance for this class, which can be used for performance reasons and as a simple way to access instance methods which don't rely on instance data (e.g. the custom SilverStripe static handling).
at line 82
array
getForceSSLPatterns()
at line 91
$this
setForceSSLPatterns(array $forceSSLPatterns)
at line 100
string
getForceSSLDomain()
at line 109
$this
setForceSSLDomain(string $forceSSLDomain)
at line 118
bool
getForceWWW()
at line 127
$this
setForceWWW(bool $forceWWW)
at line 136
bool
getForceSSL()
at line 145
$this
setForceSSL(bool $forceSSL)
at line 155
$this
setForceBasicAuthToSSL(bool|null $forceBasicAuth)
at line 164
bool
getForceBasicAuthToSSL()
at line 181
HTTPResponse
process(HTTPRequest $request, callable $delegate)
Generate response for the given request
at line 247
throwRedirectIfNeeded(HTTPRequest $request = null)
Handles redirection to canonical urls outside of the main middleware chain using HTTPResponseException.
Will not do anything if a current HTTPRequest isn't available
at line 315
int
getRedirectType()
at line 324
$this
setRedirectType(int $redirectType)
at line 335
array|bool
getEnabledEnvs()
Get enabled flag, or list of environments to enable in.
at line 348
$this
setEnabledEnvs(array|bool $enabledEnvs)
Set enabled flag, or list of environments to enable in.
Note: CLI is disabled by default, so "cli"(string)
or true(bool)
should be specified if you wish to
enable for testing.