Adding/Removing www When Accessing a Site
This is a method to automatically add or remove www when accessing a site.
You can input this in the .htaccess file.
# Adding www
RewriteCond %{HTTP_HOST} ^(?!www\.)(.+) [NC]
RewriteRule ^(.*) http://www.%1/$1 [R=301,NE,L]
# Removing www
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^(.*) http://%1/$1 [R=301,NE,L]











Comment (1)
정말 좋은 정보 감사합니다. 잘 쓰겠습니다