301 Redirects

3d Animation

Adding 301 Redirects to WordPress and HTML websites. Create or edit the .htaccess file.Use the following format, using a single line for each redirect. The first bit is the old page name followed by the full new url including the http://

Redirect 301 /old-url.html http://fullwebsiteaddress.co.uk/new-url.html
Redirect 301 /old-page.html http://fullwebsiteaddress.co.uk/new-page.html
Redirect 301 /old-file.html http://fullwebsiteaddress.co.uk/new-file.html

In WordPress add this code above – # BEGIN WordPress

Redirect Domains

To add a redirect for a domain, for example to redirect an old domain to a new domain. You can add the following .htaccess file to the root directory of your website. You need to replace – old_site.co.uk with your old domain and replace the new_site.co.uk with the new domain name.

Method 1:

Redirect 301 / http://newsite.co.uk/

Method 2:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^old_site.co.uk [NC,OR]
RewriteCond %{HTTP_HOST} ^www.old_site.co.uk [NC]
RewriteRule ^(.*)$ http://www.new_site.co.uk/$1 [L,R=301,NC]