How To add www. Into a website URL

In this article we will learn how to add www. Into a website address. If your domain does not have www. In URL you can add by following this tutorial. It’s simple and easy you don’t need to be a web developer to do that.

  1. Get to root directory of a website or wordpress
  2. Open .htaccess file
  3. Copy code from below and paste in .htaccess file

Domain Name without Www
http://example.com
This example domain name is without Www.
Domain Name with Www address
http://www.example.com

This example domain is with Www.

How to get to .htaccess File

You need to access .htaccess file which is in website’s root directory. Find your website root directly. Use Filezilla or File Manager from Cpanel to go root directory. Your website root directory will be inside the www folder or public_html folder. In other word find the folder where you WordPress is installed that’s where you will find .htaccess file.

Open .htaccess with notepad editor or any other text editor you like.

Add www. Code in .htaccess File

Put these line at the end of the .htaccess file. Save and upload .htaccess and you are all DONE.


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

Reload the website and you should now have the Www in your domain. It will automatically add Www to all of your website’s URLS.