Rella
Rella

Reputation: 66935

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

Upvotes: 7

Views: 5709

Answers (2)

Aziz Shaikh
Aziz Shaikh

Reputation: 16524

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

Upvotes: 2

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

Upvotes: 9

Related Questions