How to Redirect Visitors to Your Correct Web Address

frog-mascot

I visit a lot of websites every day. Therefore I don’t have the time to type www. in front of all web addresses. For this reason, some of the addresses throw an error in my browser. I find this extremely annoying. Simply because the remedy is so simple.

When someone owns the example.com domain name, they should allow their visitors to access their site either by typing example.com or www.example.com. It should be all the same.

But some webmasters underestimate this aspect of their domain name maintenance. Yet all these webmasters would need to do is make some simple changes to their root .htaccess files.

If you have WordPress installed, go to Dashboard > Settings > General.

Check what URLs (web addresses) are shown in the WordPress Address and Site Address boxes.

.htaccess Settings

In case, you have http://example.com entered in both boxes, use the following code in your root .htaccess file:

This will redirect all www.example.com requests to example.com. And none of your visitors will be served with an error message.

On the other hand, if you have http://www.example.com entered in both boxes, use this code in your root .htaccess file:

This will redirect all example.com requests to www.example.com. And, again, none of your visitors will be served with an error message.

If you don’t have WordPress installed and you don’t have any redirection rules in your .htaccess file, put the following line of code before the above-mentioned lines:

Address Record Settings

In some cases, you will need to set the address records (A records) for your website, too. These records map your domain name to the corresponding IP address given to you by your hosting company.

You can set your A records either in your domain registrar’s account or in your hosting company’s account or in both places. Look for something like DNS Management in your accounts’ settings.

When you find the A records, set example.com, *.example.com, and www.example.com to the IP address given to you by your hosting company, and save your settings.

 

Now you will not aggravate users who type your web address incorrectly. All your users will be served and happy. And as a positive side effect, you will not lose any visitors and thus will also boost your web traffic.

Liked this post?

Subscribe to our newsletter to receive early notification of new posts and deals:

Next Post »« Previous Post

Leave a Reply

Your email address will not be published. Required fields are marked *