- Usability and SEO Blog - https://www.nutzerfreundlichkeit.de -

SEO friendly redirect – Part2

When a site moves to another domain or renamed, can be called with the old files to the new one. permanent Redirect (301 Redirect) redirect. This type of transfer is recommended by Google. Of a temporary forwarding (302 Redirect) should be waived, since this is not optimal indexed by the Google search engine and therefore not SEO friendly.

A 301 Redirect forwarding can be implemented in several ways:

1. as a simple command in the. htaccess

Forwarding http://www.meinealtedomain.de / index.html http://www.meineneuedomain.de/index.html.
In the. Htaccess in the directory http://www.meinealtedomain.de/ will apply to the following:

Redirect permanent /index.html http://www.meineneuedomain.de/index.html

2. with the function header() in PHP

the file http://www.meinealtedomain.de / index.html contains the following:

header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.meineneuedomain.de/index.html");
header("Connection: close");

3. With mod_rewrite in the. htaccess

if http://www.meinealtedomain.de / index.html http://www.meineneuedomain.de / index.html and http moves://www.meinealtedomain.de / start.html to http://www.meineneuedomain.de/start.html, you can with the following rule in the. htaccess forward:

RewriteEngine On
RewriteRule ^(.*)\.html$ http://www.meineneuedomain.de/$1.html [R=301,L]