Permanent redirects a Web site to a new one old [Redirect web domain in .htaccess]

When we discard an old web site in exchange for a new one, it is better to keep our old website visitors and get them automatically redirected to the new one. In this case can be two scenarios.

1.The new web site is installed on the same domain name on the web site was also Vechiu.

In this situation it is best to keep URLValid URLs for all pages old, and if this is not possible, will have URLs that no longer exists to be redirectedeither by new pages relevant either to the index of the new web site (home page or home page).
The extemplu if the old web site have web address "http://numedomeniu.com/servicii.html"It is indicated as the new web project to be this address. If this is not possible, it will be made permanent redirection 301 relevant to a new address or to "home page" using file..htaccess.
In this scenario, open and edit the file..htaccessRoot domain (public, public_html most times). Add the lines:

Redirect 301 /services.htmlhttp://numedomeniu.com/portofoliu.html

Old page "servicii.html"It will be automatically redirected to the new page 'portofoliu.html".
To make redirecting page "servicii.html" to index your web site, use the line:

Redirect 301 /services.html http://numedomeniu.com/

2.The new web site is installed on a new domain name and want to do redirection from the old to the new domain name.

In this scenario, note that you needhosting (Web Hosting Services) For both areas. At least for a while, until the old domain name will no longer be present inGoogle Searchonbusiness cards, flyers, etc.ads.
Redirecting all Web pages from the old site to the first page of the new web site will be adding..htaccessCPC 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: //newlnumedomeniu. com / [L, R = 301] </ IfModule>

Once made these changes, our old web site will be automatically redirected to the new website.

Redirection using file 301 .htaccess It is available only web servers using Apache (HTTP Server) With mod_rewrite module enabled (mod_rewrite.c).

Permanent redirects a Web site to a new one old [Redirect web domain in .htaccess]

About the author

Stealth

Passionate about everything that means gadgets and IT, I write with pleasure stealthsettings.com from 2006 and I like to discover with you new things about computers and operating systems macOS, Linux, Windows, iOS and Android.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment is processed.