When we give up an old website in exchange for a new one, it is good to keep the visitors of the old site and automatically redirect to the new one. In this situation there can be two scenarios.
1.The new web site is installed on the same domain name that the old website was and.
In this situation it is good to We keep URLValid for all old pages, and if this is not possible, you will have to be the URLs that no longer exist redirectionate either to new, relevant pages, or to the index of the new website (first page or home page).
On the extemple, if we have the web address on the old web site "http://numedomeniu.com/servicii.html", It is indicated that there is this address on the new web project. If this is not possible, permanent redirection 301 will have to be relevant to" Home Page ", using the file.htaccess.
In this scenario, we open and edit the file.htaccess from the root of the domain (public, public_html most of the time). We add the lines:
Redirect 301 /servicii.htmlhttp://numedomeniu.com/portofoliu.htmlThe old page ”services.html"It will be automatically redirected to the new page"portfolio.html“.
To redirect the page "Services.html" to the website index, we use the line:
Redirect 301 /servicii.html http://numedomeniu.com/
2.The new web site is installed on a new domain name and we want to redirect from the old domain to the new.
In this scenario you remember that you needhosting (Web hosting services) for both areas. At least for a period of time, until the old domain name will no longer be present inGoogle Search, pebusiness cards,flyer, etcads.
Redirect all the pages of the old website to the first page of the new website, will be done by adding.htaccessthe old project lines:
 <IfModule mod_rewrite.c> Options +SymLinksIfOwnerMatch RewriteEngine on RewriteCond %{HTTP_HOST} ^numedomeniuvechi.com [OR] RewriteCond %{HTTP_HOST} ^www.numedomeniuvechi.com [NC] RewriteRule ^(.*)$ http://noulnumedomeniu.com/ [L,R=301] </IfModule> Once these changes are made, the visitors of the old website will be automatically redirected to the new web site.
Redirection 301 using the file .htaccess is only available for Web servers who use Apache (HTTP Server) with Mod_Rewriti module activated (mod_rewrite.c).
 
			