Hi All,
I have a subscription configure in the following way:
domain.com
domain.it [Host Alias]
domain.eu [Host Alias]
I have defined for the domain.com the preferred domain www.domain.com .
this works fine for domain.com, all request from domain.com will be seo-safe redirect to www.domain.com .
The problem is that host alias does not permit config of the preferred domain in "web service mode". (this is needed to maximize seo and offer the same site in other language for example)
So I have tried to resolve the issue via .htaccess
or as reccomanded for apache 2.4
Both works fine except for top level domain request e.g. https://domain.it or https://domain.eu: redirection not works.
Works for example https://domain.it/contact/show this is redirect to https://www.domain.it/contact/show
Can I resolve it in vhost.conf via Redirect Permanent or there are other ways ?
As for apache 2.4, the Redirect method from mod_alias seem to be the reccomanded way:
Any help was appreciated.
Regards
Fabrizio
I have a subscription configure in the following way:
domain.com
domain.it [Host Alias]
domain.eu [Host Alias]
I have defined for the domain.com the preferred domain www.domain.com .
this works fine for domain.com, all request from domain.com will be seo-safe redirect to www.domain.com .
The problem is that host alias does not permit config of the preferred domain in "web service mode". (this is needed to maximize seo and offer the same site in other language for example)
So I have tried to resolve the issue via .htaccess
Apache config:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
or as reccomanded for apache 2.4
Code:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ %{REQUEST_SCHEME}://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Both works fine except for top level domain request e.g. https://domain.it or https://domain.eu: redirection not works.
Works for example https://domain.it/contact/show this is redirect to https://www.domain.it/contact/show
Can I resolve it in vhost.conf via Redirect Permanent or there are other ways ?
As for apache 2.4, the Redirect method from mod_alias seem to be the reccomanded way:
Any help was appreciated.
Regards
Fabrizio