Add/remove www when connecting to the site

Add/remove www when connecting to the site

If you connect to the site, you can add or remove the www automatically.

Enter the .htaccess file.

# Add www

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

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

Comment (1)

Leave a Reply

이메일 주소는 공개되지 않습니다. (* 질문, 건의사항 등은 "질문게시판"을 이용해주세요)