Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any httpresponse header that would redirect user to some page of my site?

I am a server. User sends http requests to me. I wonder if there is some http response header that would tall user web browser to auto rederect to some /my/server/page.html

like image 662
Rella Avatar asked Oct 28 '11 10:10

Rella


2 Answers

You can use the Location header with a response code in the 3xx-range.

For an example:

HTTP/1.1 302 Found
Location: /my/server/page.html
like image 86
Sebastian Paaske Tørholm Avatar answered Sep 28 '22 00:09

Sebastian Paaske Tørholm


301 and 302 HTTP codes can be used to redirect requests, like this:

HTTP/1.1 302 Object moved
Date: Fri, 28 Oct 2011 10:37:34 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Location: http://www.xyz.com/abc
like image 23
Aziz Shaikh Avatar answered Sep 28 '22 00:09

Aziz Shaikh