Kilho.net
IT

Aggiunta/rimozione di www all’accesso al sito

Come aggiungere o rimuovere automaticamente www quando si visita un sito.

Inserite il codice nel file .htaccess.

# Aggiungere www

RewriteCond %{HTTP_HOST} ^(?!www\.)(.+) [NC]
RewriteRule ^(.*) http://www.%1/$1 [R=301,NE,L]
# Rimuovere www

RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^(.*) http://%1/$1 [R=301,NE,L]

1 commento

  1. 이주노

    정말 좋은 정보 감사합니다. 잘 쓰겠습니다

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *