# HTTP Redirects

**URL redirection** also known as ***URL forwarding***

is a technique to give more than one URL address to a page, a form, a whole website, or a web application. HTTP has a special kind of response, called a ***HTTP redirect***, for this operation.

eg; What you see when [`twitter.com`](http://twitter.com) redirects to [`x.com`](http://x.com) is referred to in backend/software engineering as a **URL redirection.**

**Redirects accomplish numerous goals:**

* Temporary redirects during site maintenance or downtime
    
* Permanent redirects to preserve existing links/bookmarks after changing the site's URLs, progress pages when uploading a file, etc.
    
    In HTTP, redirection is triggered by a server sending a special redirect response to a request. Redirect responses have [status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) [that start w](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status)ith 3, and a [Location](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) [header h](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location)olding the URL to redirect to.
    

## **Alternative way of specifying redirections**

HTTP redirects aren't the only way to define redirections. There are two others:

1. HTML redirections with the [`<meta>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta) element
    
2. JavaScript redirections via the [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)
    

### **Why It Matters;**

* For **SEO**: A 301 tells search engines to transfer SEO rankings, eg from [`twitter.com`](http://twitter.com) to [`x.com`](http://x.com).
    
* For **User Experience**: Ensures users who type the old domain still reach the new site.
    
* For **Brand Migration**: Reflects Twitter's rebranding to "X".
    

Also check;[https://www.clickssl.net/blog/redirect-http-to-https](https://www.clickssl.net/blog/redirect-http-to-https)
