Knowledgebase Banner Advert

How do I redirect my site? non-www to www

A redirect is a simple way to automatically correct a users request to the correct page if you have moved the resource.

To make a redirect for a changed page, you need to add the following into a .htaccess file:

redirect <STATE> /old_page.name <FULLDOMAIN>/new_page.name

The <STATE> can be either

  • 301 - Moved Permanently - This and all future requests should be directed to the given URI
  • 307 - Temporary Redirect - In this case, the request should be repeated with another URI; however, future requests should still use the original URI.

So for example, if you wanted to permanently redirect www.example.com/smith.html to www.example.com/jones.html, you would put an .htaccess file in the web root folder of of your domain with the following:

redirect 301 /smith.html http://www.example.com/blog/jones.html

Use redirect to stop duplicate content on search engines

To prevent search engines being confused about your site, i.e. Is it http://yourdomain.com or http://www.your.domain.com, add the following to a .htaccess file

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

This will cause anyone who uses example.com to be automatically redirected to www.example.com

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Why are my FTP transfers timing out following upgrading to Internet Explorer 11?

Some users of Windows 8.1 have found that following an update to Internet Explorer 11,...

The images on my website have been corrupted, what went wrong?

Sometimes this can occur as a result of uploading your images using FTP, most...

Why can't I upload large files with FTP?

FTP uploads are limited to 200MB per file. If you really need to use a...

I can login to FTP via my client, but I can't see a directory listing of my site files?

If your FTP client appears to log in correctly but no files or directories...