How to force away from / to www.

There are many ways to force www/non www, but this way requires to create/edit .htaccess file (htdocs/.htaccess)

Forcing away from www.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.yoursite.gg [NC]

RewriteRule ^(.*)$ http://yoursite.gg/$1 [L,R=301]

                                          ^^ changing that to https forces away from www. and also forces https encryption

Forcing to www.

Its basically the same thing
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.gg [NC]

RewriteRule ^(.*)$ http://www.yoursite.gg/$1 [L,R=301,NC]

                                          ^^ changing that to https forces www. and also forces https encryption

6 Likes

Shd be…

You left out www