Glossary · ENCheck a domain

Redirect

A web redirect is an instruction that sends a browser or other program making HTTP requests from one web address to another. The old address's server responds with an HTTP status code and usually a response field called the Location header that names the new address. The client may then make another request to that destination.

What happens when a browser follows a redirect?

Suppose a visitor opens http://example.com. The server can respond with a redirect to https://example.com/, asking the browser to repeat the request using HTTPS. The browser follows the instruction and loads the destination page. The address bar changes because the browser has been sent to a different URL.

Redirects are used when a page has moved, when a site chooses one preferred address, or when it sends visitors from HTTP to HTTPS. The redirect itself does not move the page files or guarantee that the new address works; the destination still needs to return a valid response.

Is a redirect the same as a CNAME record?

No. A CNAME record is part of DNS: it makes one name an alias for another name while DNS resolves the destination. A web redirect happens after a client reaches an HTTP server, which returns an instruction to request another URL. A CNAME does not change the browser's address bar; an HTTP redirect usually does.

For example, DNS could resolve www.example.com to a web server, and that server could redirect visitors to example.com. The DNS answer gets the browser to a server; the redirect then tells the browser which URL to request.

Related terms