Forcing www. is just one of many functions you can perform via an .htaccess file. For more information on .htaccess, visit our blog post:

If you want to force www. add the following code to your .htaccess file:

Example of forcing code www.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^vasdomen.com
RewriteRule (.*) http://www.vasdomen.com/$1 [R=301,L]

If you want to force https add the following code to your .htaccess file:

Example code for forcing https.

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

For more information on the benefits of switching from HTTP to HTTPS, see the following article:

More about the transition from HTTP to HTTPS:

In case you want to force www. and https protocol Your code should look like this:

Primer koda za forsiranje www. i https protokola.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^vasdomen.com
RewriteRule (.*) http://www.vasdomen.com/$1 [R=301,L]

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

WEBSITE QUERY