HTML redirect: visitor flow control

The redirection mechanism ( html redirect ) from one address to another is important, first of all, from the point of optimization of the browser address bar . Depending on the competence of the site developer, anything can be written in it, while it is quite enough to have just the name of the site there.

Visiting a site, a visitor can write in the address bar: URL: //index.html, URL: //index.htm, URL: //index.php, URL: //index.phpp ... A simple server rules mechanism makes “Redirect from html to without html”, that is, it provides the ability to remove unnecessary tails (.htm, .html, .php ...) in the address bar, and not only them:

  • RewriteEngine On.
  • RewriteBase /.
  • RewriteRule (. *) \. (Html ​​| htm | php | phpp) $ $ 1 [R = 301, L].

Written in the .htaccess file in the root of the site will lead to the address bar:

URL: // index

HTML redirect

The meaning of redirection

By and large, the browser is a commonplace entry into the IP-address space. Thanks to numerous DNS, DHCP, and other mechanisms, all this space is projected onto specific domain names that are easy to understand by a simple visitor. However, not in all cases it makes sense to show in the address bar what is actually there. Making an html redirect is a good solution. In unprincipled cases or due to technical necessity, for example, when working with phpMyAdmin or when debugging a site, you can allow something in the address bar that is not perceived, as in the picture below.

Complex Address Bar Example

But in practice, it is better not to load the visitor’s perception with unnecessary information. The visitor came to the site for goods, services, information, and he was least interested in the contents of the address bar of the browser.

However, from the point of view of the site’s perception, the developer should correctly display the site address, the active page and exactly the way the visitor will remember it in the address bar.

Technical need

Assuming that the server at the site’s entry point works flawlessly, you can start planning a redirect from it. A rare site is created once to exist forever, periodically it is necessary to repair individual pages or a resource as a whole.

If earlier it was possible to write that technical work is underway on the site and not to do an HTML redirect, today it is perceived as disrespectful of the site owner to its customers. The phrase "We apologize for the inconvenience!" only exacerbates the situation.

Redirect from html to without html

Common redirect practice

Not all developers or always have the opportunity to perform work on the reconstruction or completion of sites on their own servers. Often, work is performed on an existing resource.

Redirecting an html page is the simplest and most effective solution.

The easiest redirect

By specifying HTTP-EQUIV = Refresh and the desired CONTENT = "..." in the META tag , you can redirect requests that have come to the domain name to the desired address on the Web.

Redirect - an important part of the site

The technologies have become perfect, and the center of competition has shifted to the side of service: the quality of services, goods, information, etc. has become an essential point in making a decision. The speed and efficiency of work with the flow of customers has also come to the fore.

If yesterday the word site meant one IP address or one domain name, today a rare site in its work does not use html redirect through other pages, through other sites. These can be pages of authorization, collection of statistical data, forms of information transfer.

Make html redirect

A modern website is far from always being one domain name and one IP address. A site is more often called a web resource, and this is understood as the fact that numerous parts of the site are distributed according to real geographical positions or are configured from a technical point of view to distributed information processing.

The html redirect allows visitors from Russia to be sent to a server in Moscow, and visitors from America to a server in Washington. Although the speed of communication lines rarely depends on distances, such a scheme allows the Russian part of the site to focus on Russian-speaking visitors and offer addresses for the provision of services, purchase of goods in the immediate vicinity of the visitor’s IP address, and for Americans to offer everything in English and within them availability.

Html page redirect

An important component of any web resource is the technical side: reliability, stability, security. Html redirect allows you to instantly switch the server. All visitors that came before the redirection still continue to be served on the main server, but the next ones already go to another, auxiliary one. As soon as the first one satisfies the interest of the last visitor, he becomes preventive.

The reverse Html redirect frees up the secondary server, and the main server takes over again. Such switching allows full-fledged preventive work, invisible to visitors.

A simple redirect to an html page - but there are so many possibilities.

Source: https://habr.com/ru/post/K16847/


All Articles