Joomla community powered logo

Site Slogan

How to make sure your website is always accessed via its www-domain name variant

Redirection using .htaccess (Apache)

If you want to make sure everybody who wants to access your site comes to it by using the www-name, then add the following to your .htaccess file:

# Redirect to www
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ [NC] RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

These rules work for both HTTP and HTTPS. Save your file to its original place and your done! Oh yes, and don't forget to check if everything works the way you intended.


  1. Comment line to indicate in your .htaccess file why you have added this part
  2. This line is an Apache directive (prerequisite for mod_rewrite)
  3. This line makes sure you can use the rewrite features of Apache (enables mod_rewrite)
  4. This line sets the basic directory for your rewrites to the root directory of your site
  5. This line checks if you have provided a correct domainname.tld combination with 2 parts in it (so it detects the www is lacking) - the URL starts with 1 or more characters different from a dot, followed by exactly 1 dot, followed by 1 or more character different from a dot. The $ indicates that this is the end of the regular expression, so it will only catch your domain name, all extra parts of the URL will not be affected. [NC] indicates that the regular expression has to be checked case insensitive
  6. This line checks whether you are using http or https
  7. This line does the actual rewrite of your original URL to ensure it contains "www." at the start of the URL. R=301 indicates that this URL is permanently moved, L indicates it is the last rule that will be processed for redirection of this kind of input which meets the rewrite conditions


  • If you already have "Options +FollowSymLinks" defined somewhere earlier in your .htaccess file, then there is no need to declare it here for a second time
  • Same goes for "RewriteEngine On": if it's already defined earlier in your .htaccess file, you don't have to add it for a second time
  • Same goes for "RewriteBase /": if it's already defined earlier in your .htaccess file, you don't have to add it for a second time

NOTE! This site uses cookies.

If you do not change browser settings, you agree to it. Learn more

I understand


To make this site work properly, we sometimes place small data files called cookies on your device. Most big websites do this too.

What are cookies?

A cookie is a small text file that a website saves on your computer or mobile device when you visit the site. It enables the website to remember your actions and preferences (such as login, language, font size and other display preferences) over a period of time, so you don’t have to keep re-entering them whenever you come back to the site or browse from one page to another.

How do we use cookies?

A number of our pages use cookies to remember:

Also, some videos embedded in our pages use a cookie to anonymously gather statistics on how you got there and what videos you visited.

Enabling these cookies is not strictly necessary for the website to work but it will provide you with a better browsing experience. You can delete or block these cookies, but if you do that some features of this site may not work as intended.

The cookie-related information is not used to identify you personally and the pattern data is fully under our control. These cookies are not used for any purpose other than those described here.

How to control cookies

You can control and/or delete cookies as you wish – for details, see You can delete all cookies that are already on your computer and you can set most browsers to prevent them from being placed. If you do this, however, you may have to manually adjust some preferences every time you visit a site and some services and functionalities may not work.

You can find the full EU privacy guideline by clicking on this link