Adding www to a url/it: Difference between revisions
From Joomla! Documentation
Created page with "==Come ottengo il prefisso www in tutti i miei siti Joomla!?==" |
Created page with "Aggiungi il seguente <tt>.htaccess</tt> file:" |
||
| Line 2: | Line 2: | ||
==Come ottengo il prefisso www in tutti i miei siti Joomla!?== | ==Come ottengo il prefisso www in tutti i miei siti Joomla!?== | ||
Aggiungi il seguente <tt>.htaccess</tt> file: | |||
<source lang="Apache"> | <source lang="Apache"> | ||
Revision as of 14:10, 9 September 2023
Come ottengo il prefisso www in tutti i miei siti Joomla!?
Aggiungi il seguente .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
A more complete solution fixing several other canonicalisation issues at the same time:
RewriteEngine On
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html?$ http://www.example.com/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.example.com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]