2.7.1.1.4. Features of the redirect when using a dedicated IP
When activated in site settings options «This site handles direct requests to a dedicated IP address» the RewriteRule processing logic changes in .htaccess: instead of HTTP_HOST
should use HTTP:X-Real-host
.
Working redirect directives with www.example.com
on example.com
will look like this:
RewriteCond %{HTTP:X-Real-host} ^www.example.com RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
Attention!
Some CMS may ignore this feature and continue to use the titleHTTP_HOST
, which can cause infinite redirects due to incorrect definition of the current host. In particular, the problem can be observed in WordPress. Disabling the option is a quick fix. «This site handles direct requests to a dedicated IP address».