301 redirect

This article applies to 123-reg Linux Shared Hosting packages.

If you have a 123-reg Linux hosting package with a domain you can set up a 301 redirect using a .htaccess file. This will catch any traffic on your old site and redirect it to your the index of your new site.

To do this, please do the following:

1

Open up a text editor such as "Notepad".

2

Copy the following line of code into your text editor, replacing http://www.example.com/ with the URL you wish to forward your domain name to.

Redirect 301 / http://www.example.com/

3

Save the file as .htaccess.

4

Upload the file to your web space.

Redirect www to non www version of site

To force your site to always show the non-www URL, please do the following:

1

Open up a text editor such as "Notepad".

2

Copy the following line of code into your text editor, replacing http://www.example.com/ and example\.com with your domain name.

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

3

Save the file as .htaccess.

4

Upload the file to your web space.

Offer

Answer options

Your feedback was successfully added.

Answer tracking

Track

Watch the content of this article for changes.