HTTP redirect code to redirect the network to the mobile version

What is the best HTTP redirect status code to redirect a web page to the mobile version?

From: www.example.com

To: m.example.com

+3
source share
2 answers

I sent 301 when using Vary to specify request header fields that lead to this server -driven negotiation solution.

So, assuming the User-Agent header field is used to distinguish whether the request was made by the mobile device, I would use this:

HTTP/1.1 301 Moved Permanently
Vary: User-Agent
Location: http://m.example.com/...
+6
source

A temporary redirect (302 or 307) should be sufficient for this.

Google -

, HTTP 301 302.

, 302, , 307.

, "" 200.

+4

All Articles