How to redirect to another domain. Setting up the “Domain Redirection” service. Redirect to new page

💖 Do you like it? Share the link with your friends

When changing a domain, it becomes necessary to redirect users from one domain to another. For this purpose it is used 301 redirect. It allows you to inform search engines that the redirect is permanent, and also saves the weight received by web pages in particular and the site in general. It is noteworthy that to automate redirection from one domain to another, it is convenient to use the corresponding 301 redirect directives in the file .htaccess. We will talk about this and some features of this process.

Before creating a 301 redirect...

Let me start with the fact that before creating a redirect, you should carefully check the functionality of the site on the new domain. In particular:

  • Check the directives in the file robots.txt.
  • Check the meta tags Robots on the site’s web pages, on a new domain.
  • Check the meta tags canonical.
  • Check page availability.
  • Be sure to create 404 page and install a counter on it, this will allow you to track the presence of problems in the future.

For more information about the loss of traffic after site reorganization, read. Only if you are confident in the functionality and accessibility of the site for search robots on the new domain, you can proceed with further actions.

Redirection from one domain to another in .htaccess

There are quite a lot of options for solving the problem. Personally, I recommend using this option?


RewriteEngine on
RewriteCond %(REQUEST_FILENAME) robots.txt$
RewriteRule ^([^/]+) $1 [L]
RewriteCond %(HTTP_HOST) ^(www\.)?old-domain\.ru$
RewriteRule ^(.*)$ http://www.new-domain.ru/$1

What's good about this option? Firstly, it excludes the file from the redirect on the old domain robots.txt, which allows you to specify a Host directive in it indicating a new domain. This only works for the Yandex search engine, read more. I will note that the Host directive can be specified anywhere, but it would be better to specify it like this:

User-agent: Yandex
Disallow: /cgi-bin
Host: www.new-domain.ru

Secondly, this option redirects from one domain to another, regardless of whether it was specified in the old domain www. or not, both options are taken into account.

It is also obvious that for the above example of a redirect to work, you must specify their domains. I draw your attention to the fact that in the regular expression of the RewriteCond directive it is necessary to escape special characters, the same dot character (.), for example: old-domain\.ru , while for a new domain this is not necessary, but you need to start with HTTP protocol, i.e. http:// etc.

By the way, a new domain can be specified without www. at the beginning, but don’t forget about the main mirror here.

Recommendation 1: Even before installing the redirect, you can use the Host directive for Yandex and the canonical meta tag for Google, as well as the file sitemap.xml with URLs of pages on the new domain; wait for gluing and only then install the redirect.

Note: You can check the gluing in Yandex by adding a non-main mirror (old domain) to the Report a new site form, it returns the corresponding message: The site you specified is a non-main mirror of the site...

In Google, you can use the info: search query operator for this, specifying the old domain as the value, for example: info:old-domain.ru.

You can also use a number of online services, for example: checking a domain for gluing from SEOGadget, checking gluing on webmasters.ru, etc.

From my point of view, it is better to immediately set a 301 redirect with file exclusion robots.txt, which will save us from unnecessary movements and problems with takes.

Recommendation 3: use the " Change of address» in the Google Webmaster Tool to notify Google of your new site domain. To do this, a site on the old domain must be added and verified. Select it from the list. On the page that opens, click on the list with the gear icon, and then the item “ Change of address».

  • Site Indexing > Excluded Pages- in Yandex.Webmaster.
  • Scan > Scan Errors(tab " Not found") - in Google Webmaster Tools.

That's all I have. Thank you for your attention. Good luck!

at 6:00 Edit message 14 comments

The Domain Redirection service allows you to set up rules and redirect the visitor who accesses the domain name to the Internet address you specify. The service supports work with any domains. .

In this article we will talk about the settings for working with the service.

Domain setup

The service can only work if your domain is delegated. To delegate a domain, DNS servers are needed that could provide Internet users with information about your domain (zone). There must be two or more such servers.

The Domain Redirection service already includes support DNS. If the service is ordered under the same contract as the domain, then the settings are made automatically when ordering.

You can also independently specify DNS servers depending on the level of the domain for which the redirection service is ordered:

ns3-fwl2.site
ns4-fwl2.site
ns8-fwl2.site

ns3-fwl3.site
ns4-fwl3.site
ns8-fwl3.site

ns3-fwl4.site
ns4-fwl4.site
ns8-fwl4.site

ns3-fwl5.site
ns4-fwl5.site
ns8-fwl5.site

Zone file entries

If you use DNS servers included in the Domain Redirection service, then the necessary records are entered automatically.

When using your own DNS servers, you need to add A records to the domain zone file on the primary DNS server. As part of one redirection service, the same IP address must be specified for the domain itself and any of its subdomains.

Depending on the domain level for which the redirection service is ordered, the A records should be as follows:

  • for a second level domain, type web-forward.ru:

    web-forward.ru. A 109.70.27.4

  • for a third level domain, type test.web-forward.ru:

    test.web-forward.ru. A 109.70.27.5

  • for a fourth level domain, type forum.eng.web-forward.ru:

    forum.eng.web-forward.ru. A 109.70.27.6

  • for a fifth level domain, type www.forum.eng.web-forward.ru:

    www.forum.eng.web-forward.ru. A 109.70.27.7

Setting up the Domain Redirection service

Redirection can be enabled for a domain, all its subdomains, and you can also configure up to ten individual redirection rules for specific subdomains.

You can make changes to the service settings in Section for clientsServicesViewing and changing data.

For each redirection rule, you can specify the following parameters:

1. Name of the subdomain for which the rule is being configured

You must specify the subdomain from which the redirect will be made. You can specify:

  • the name of the subdomain for which you want to configure redirection. An unlimited number of nesting levels is allowed, but the length of the entry, including periods, should not exceed 63 characters;
  • “*” (asterisk) if you need to set a general redirection rule. This rule will apply to any subdomains for which individual rules are not configured.

2. Forwarding address

URL of the page to which the visitor will be automatically redirected.

3. Redirection method

You can choose one of the following redirection methods:

  • Temporary or permanent redirection

Temporary redirection (HTTP response code “302 Moved Temporarily”). The HTTP 302 response code tells client applications (including search engines) that the site has moved temporarily. Installed by default.

Permanent redirection (HTTP response code “301 Moved Permanently”). The HTTP 301 response code tells client applications (including search engines) that the site has moved permanently.

In both cases, the visitor is automatically redirected to the URL of the page to which the redirect was made. The choice of redirection method (301, 302) in practice only matters for search engines.

  • Masking an address in a frame

With this redirection method, the web page will be inside a frame. Whenever clicking on links inside the frame, visitors will see the domain name from which the redirect was made in the address bar of the browser. The text you specified in the redirection rule settings will be displayed as the title of the page.

If you choose to mask the address in the frame, please note that:

  • When setting links within your web page to other resources, you must specify target=_top in the link tag. Otherwise, someone else's web page will also be opened inside your frame, and the visitor will see your domain name in the URL box. An example of the correct spelling of a link for this case: RU-CENTER
  • The true address of the web page to which the redirect is made, although not displayed in the URL bar, can be easily determined by any visitor.

4. Option “With path saving”.

When you try to access a page located on the domain for which the rule is being drawn up, the redirection will occur to the redirection address, to which the path to this page will be added..web-forward.ru, then when accessing the page dns.web-forward..

Good afternoon, my readers! I think this material will be very interesting for you! Let's talk about what a redirect from domain to domain is. Imagine, you type the website president.ru, and after that, it lands on yours! And now you have hundreds of thousands of fans.

What is a redirect?

301 redirect is a redirection from one site to another.

It is also possible to transfer without hosting from one page of the site to another. We’ll talk about how to do this in today’s blog.

htaccess itself 301 redirect necessary for a programmer and web designer so that he can move from one subdomain to another. For example, there are often cases when a good and high-quality website suddenly falls under the filters of search engines. At the same time, those readers of the Internet resource who store it in their search engine bookmarks or have a subscription to RSS news, by typing the address they already have, go to "filtered" website.

In addition, redirect is used to, having a main project, increase its ranking in search engines, and by purchasing a new “advanced” domain and redirecting to your own Internet resource. Thus, the rating of your portal increases.

And finally, a redirect must be used to switch from free hosting to its paid equivalent.

How to make a 301 redirect?

To perform a redirect, you need to find the htaccess file in the root folder (the root folder is the folder where your site is located). Typically these are server folders that can be accessed via ftp such as www, domains, or /public_html or HTMLDOCS. Next, to move from site to site, you need to write code (or copy and paste it)

Redirect 301 /old-page.html http://new-domain.ru/new-page.html
or
Redirect permanent /old-page.html http://new-domain.ru/new-page.html

You can also use another redirect in order not to add links for addresses in htaccess

RedirectMatch /(.*)\.php$ /$1.aspx

In order for your reader to be redirected from a site to another, you should use the following entry:

Redirect / http://www.domain.com

301 redirect from domain withwwwwithout it looks like this:

RewriteEngine on
RewriteCond %(HTTP_HOST) ^ www.nic.ru
RewriteRule ^(.*)$ http:// www.nic.ru /$1

301 redirect from a domain without www to with www:

RewriteEngine On
RewriteCond %(HTTP_HOST) ^ timeweb.com
RewriteRule (.*) http://www. timeweb.com /$1

To forward Cyrillic domains, you need to use the punucod converter. To do this, the address you already have (for example, president.rf) using the http://wwhois.ru/punycode.php service (by entering the site) must be changed to www.xn--d1abbgf6aiiy.xn--p1ai.

Experienced programmers can also redirect a domain to a web address - DNS web direct. But this is already a higher level.

As an example, try to redirect the following domains yourself: http://2domains.ru/, http://timeweb.com, https://www.nic.ru.

It is very convenient to use the domain forwarding service http://2domains.ru/. It allows you not only to redirect your domain to another address, but also to have an unchangeable address for your page without hosting or changing providers. Also, you can use this service to register an additional domain.

By owning one page, for example mypage, you can purchase a full domain name on the main section of the site www.mypage.ru/mybrand/index.html. This allows you to do direct advertising of an Internet resource, and readers will directly indicate the address of your resource’s web page and find the landing page!

In addition, using the multiple redirection service, it is easy to redirect from one site to others if necessary.

You can come up with ways to use the redirect yourself. It's very convenient and simple! You just have to try it! Try it!

That's all for today. Subscribe to updates. I look forward to your comments, see you in the next blog! Bye bye.

Best regards, Roman Chueshov

The first reason for changing the site address may be if the old domain is under a filter or is poorly indexed, then perhaps changing the site address will solve this problem. The second reason may be a banal desire and desire to change the domain to a more attractive one. In this article we will look at the algorithm for changing the domain address. How to do this correctly so as not to lose traffic and positions.

Step-by-step instructions for changing the website address

1. Copy all site files to the new domain (do not delete anything from the old domain yet). It is advisable to preserve the entire structure of the site, otherwise the positions may change quite significantly.

2. Write the host directive with the address of the new domain in both robots.txt:

User-agent : * Host : newdomen.ru

This must be done both on the old domain and on the new one:

olddomen.ru/robots.txt newdomen.ru/robots.txt

3. In Yandex Webmaster, go to the "Indexing Settings" "Moving Site" section and specify the address of the new domain.

Google Webmaster also has an option to “change site address”.

4. After the change, it is advisable to wait until search engines merge these domains.

5. You need to make a 301 redirect from the old domain to the new one. Read on to find out how to do this.

301 redirect from old domain to new

The most correct and easiest way to do this is through the .htaccess file (located in the root of the site). This code needs to be placed on the old site, it does not need to be placed on the new domain!

Options +FollowSymLinks RewriteEngine On RewriteCond %(REQUEST_FILENAME) robots.txt$ RewriteRule ^([^/]+) $1 [L] RewriteCond %(HTTP_HOST) ^oldomen\.ru RewriteRule ^(.*)$ http://newdomen. ru/$1 RewriteCond %(HTTP_HOST) ^www.olddomen\.ua RewriteRule ^(.*)$ http://newdomen.ru/$1

Or the second option

Options +FollowSymLinks RewriteEngine On RewriteCond %(REQUEST_FILENAME) robots.txt$ RewriteRule ^([^/]+) $1 [L] RewriteRule (.*) http://newdomen.ru/$1

This article is out of date.

This article was written for the Shared Hosting service, which is deprecated as of June 1, 2019.

The current hosting service can be ordered on our website

Redirecting from one domain to another (redirectors)

From time to time, our clients come to us with the same question: how to redirect from one domain name to another. Typically, questions come down to one of two options:

  1. Your website opens at www.mycompany.ru and mycompany.ru. You want that when accessing a site address from www, there is a redirect to the same page on a domain without www (http://www.mycompany.ru/news/ » http://mycompany.ru/news/)
  2. You have a main domain mycompany.ru and an alternative domain my-company.ru. It is necessary to ensure that when typing the address my-company.ru in the browser, the visitor is automatically transferred to the main domain mycompany.ru

First task the simplest way is solved in section. To the left of the site name, you need to click on the icon with three horizontal stripes and select “Fine settings”. Next, activate "Enable redirection". After this, all that remains is to choose which domain to redirect all requests to. Ready!

Show how you can solve the first problem using mod_rewrite

Also first task can be solved using mod_rewrite. To set up redirection from addresses starting with www to similar ones without www (http://www.mycompany.ru/news/ » http://mycompany.ru/news/), you need to the .htaccess file in the root www folder of your site write the following lines:

RewriteEngine On RewriteCond %(HTTP_HOST) ^www\.mycompany\.ru$ RewriteRule ^(.*)$ http://mycompany.ru/$1

If, on the contrary, you need addresses without www to be automatically redirected to the same addresses with www (http://mycompany.ru/news/ » http://www.mycompany.ru/news/), for example, as is done on our website: automatically redirects you to , then the mod_rewrite rules look like this:

RewriteEngine On RewriteCond %(HTTP_HOST) ^mycompany\.ru$ RewriteRule ^(.*)$ http://www.mycompany.ru/$1

Second task can also be solved using the mod_rewrite rules, but if you are hosted on a Light, Standard or Pro tariff plan, you are limited by the number of domains included in the tariff. Therefore, setting up a site with only one .htaccess file will deprive you of one more domain in your tariff quota, which is not always acceptable. In this case, we suggest using the service.

You need to remove the A record for the my-company.ru domain from and then create a . In this case, a new A-record will be automatically created for the my-company.ru domain, which will point to the redirect service.

Is it possible to solve first task also using the Panel Redirectors service? Yes, you can, but this will lead to the fact that instead of redirecting http://www.mycompany.ru/news/ » http://mycompany.ru/news/ you will receive a redirect to http://www.mycompany.ru/news / » http://mycompany.ru/, that is, any url on the redirected domain will lead only to one specific page of the destination domain. This is unlikely to be what you need.



tell friends