LA IDEA ÚTIL

Comprueba la dirección junto con el método y el cuerpo recibidos. Dos redirecciones permanentes pueden representar el mismo traslado para la búsqueda y comportarse de forma distinta con una operación enviada.

Distingue el traslado de la solicitud

Google incluye 301 y 308 entre las redirecciones permanentes que señalan una nueva ubicación. Esa clasificación ayuda a describir el traslado de una página; no sustituye comprobar los métodos que acepta una ruta utilizada también por formularios o aplicaciones.

RFC 9110 permite que, por razones históricas, un cliente cambie POST a GET al seguir un 301. La redirección 308 conserva el método cuando el cliente la sigue automáticamente. Eso no obliga a cualquier cliente a seguir toda redirección ni demuestra que el destino sepa procesar la operación.

Define un caso sin datos reales

El ejercicio utiliza dos rutas de prueba del mismo origen: /old-301 y /old-308. Ambas responden con Location: /echo. El cliente envía un POST con el cuerpo ficticio item=demo. El destino devuelve para inspección el método y el cuerpo recibidos.

No son rutas del sitio Jincheng ni formularios de clientes. La comprobación se hizo localmente con Node.js 22.22.3, utilizando su cliente fetch. Conservamos esa versión porque el comportamiento observado pertenece a un cliente concreto; la descripción del estándar y la prueba cumplen funciones diferentes.

Compara qué recibió el destino

En la prueba con 301, el destino recibió GET y un cuerpo vacío. Con 308 recibió POST y item=demo. La dirección final /echo fue la misma, pero el mensaje que llegó no lo fue. El resultado 301 muestra un cambio permitido por el estándar, no una obligación de que todos los clientes actúen igual.

Si el destino espera datos de un formulario, recibir GET podría mostrar una página sin completar la tarea. Un 200 final tampoco demostraría por sí solo que se registró una solicitud. Habría que comprobar el resultado funcional que el servicio promete, además del intercambio HTTP.

Prueba los recorridos que utiliza la ruta

Antes de un traslado real, identifica si la dirección recibe solo lecturas o también otros métodos. En un entorno autorizado de prueba, conserva cliente, método inicial, cuerpo ficticio, respuesta, Location, método final y resultado esperado. Sigue la cadena completa si hay más de un salto.

No utilices un formulario productivo con datos reales para averiguar cómo se repite una operación. Un POST puede producir efectos y repetirlo no equivale a abrir un enlace. Si el cliente no sigue el redireccionamiento o el destino rechaza el método, registra ese resultado en lugar de forzar una confirmación.

Elige por el contrato completo de la ruta

Cuando el traslado es permanente y debe conservar el método, revisa si 308 corresponde al contrato y a los clientes utilizados. Si el diseño pretende mostrar una página después de procesar un formulario, necesita evaluar ese flujo específico; no todos los destinos de un POST tienen el mismo propósito.

Guarda las pruebas de lectura y de envío por separado. Esta guía no cambia las redirecciones publicadas de Jincheng ni afirma que usar 308 mejore posiciones. La lección del ejemplo es más concreta: una URL correcta y una respuesta final satisfactoria no verifican, por sí solas, la operación que llegó hasta allí.

COMPLETE ENGLISH TRANSLATION

301 or 308: moving a route also means checking the method

A form endpoint moves to another address. Opening the new link works, but that read does not tell you what happens when a client sends a POST to the old route.

Open the English edition ↗

Check the address alongside the method and body received. Two permanent redirects can represent the same move for search while behaving differently for a submitted operation.

Distinguish the move from the request

Google includes 301 and 308 among permanent redirects indicating a new location. That classification helps describe a page move; it does not replace checking methods accepted by a route also used by forms or applications.

For historical reasons, RFC 9110 permits a client to change POST to GET when following a 301. A 308 preserves the method when a client follows it automatically. This neither requires every client to follow every redirect nor establishes that the destination can process the operation.

Define a case without real data

The exercise uses two same-origin test routes: /old-301 and /old-308. Both respond with Location: /echo. The client sends a POST with the fictional body item=demo. The destination returns the received method and body for inspection.

These are neither Jincheng routes nor customer forms. The check ran locally using Node.js 22.22.3 and its fetch client. We retain that version because the observed behavior belongs to a particular client; the standard's description and the test serve different purposes.

Compare what the destination received

With 301, the destination received GET and an empty body. With 308, it received POST and item=demo. The final /echo address was identical, but the arriving message was not. The 301 result demonstrates a change permitted by the standard, rather than a requirement for every client to behave identically.

If the destination expects form data, a GET could display a page without completing the task. A final 200 alone would not establish that a submission was recorded either. You would need to check the service's promised functional result as well as the HTTP exchange.

Test the paths the route actually uses

Before a real move, identify whether the address receives only reads or other methods too. In an authorized test environment, retain client, starting method, fictional body, response, Location, final method and expected result. Follow the entire chain if there is more than one hop.

Do not use a production form with real data to discover how an operation repeats. A POST can have effects, and repeating it is not equivalent to opening a link. If the client declines to follow the redirect or the destination rejects the method, record that outcome rather than forcing confirmation.

Choose for the route's full contract

When a move is permanent and must retain the method, check whether 308 fits the contract and actual clients. A design intended to display a page after processing a form needs its own flow assessment; POST destinations do not all serve the same purpose.

Keep read and submission checks separately. This guide neither changes Jincheng's published redirects nor claims that 308 improves rankings. The example's lesson is narrower: a correct URL and satisfactory final response alone do not verify the operation that arrived there.

完整中文翻译

301 还是 308:迁移路径时,也要检查请求方法

接收表单的路径迁移到了新地址。打开新链接能够正常显示,但这次读取并不能说明客户端向旧路径发送 POST 时会发生什么。

打开中文独立页面 ↗

除了地址,还要检查实际收到的方法与请求体。两种永久重定向在搜索中都可表示迁移,却可能对提交操作产生不同结果。

区分地址迁移与请求本身

Google 将 301 和 308 列为表示新位置的永久重定向。这种分类有助于说明页面迁移,但不能代替检查表单或应用也会使用的路径所接受的方法。

RFC 9110 出于历史原因,允许客户端跟随 301 时将 POST 改成 GET。客户端自动跟随 308 时则保持原方法。这不要求所有客户端跟随任何重定向,也不能证明目标能够处理操作。

定义不含真实数据的案例

练习使用同源的两条测试路径:/old-301 和 /old-308。二者都返回 Location: /echo。客户端发送 POST,请求体为虚构的 item=demo;目标返回实际收到的方法和请求体,以便检查。

这些不是 Jincheng 的路径,也不是客户表单。测试在本地使用 Node.js 22.22.3 的 fetch 客户端执行。保留版本,是因为观察属于一个具体客户端;标准说明与测试本身承担不同作用。

比较目标实际收到什么

301 测试中,目标收到 GET 和空请求体。308 测试中,目标收到 POST 和 item=demo。最终 /echo 地址相同,到达的消息却不同。301 的结果展示标准允许的一种变化,不代表所有客户端都必须这样做。

如果目标需要表单数据,GET 可能只显示页面,却没有完成任务。最终返回 200,也不能独自证明申请已被记录。除了 HTTP 交换,还需检查服务承诺的具体功能结果。

测试路径真正支持的流程

实际迁移前,确认地址是否只有读取请求,还是接收其他方法。在获准的测试环境中记录客户端、起始方法、虚构请求体、响应、Location、最终方法及预期结果。如果存在多个跳转,应检查整条链。

不要用带真实数据的生产表单试探操作如何重放。POST 可能产生作用,重复它并不等于打开链接。若客户端不跟随重定向,或目标拒绝该方法,应记录结果,不要强行认定成功。

按路径的完整约定选择

如果迁移永久有效,而且必须保持方法,应检查 308 是否符合约定及实际客户端。如果设计目的是处理表单后显示页面,就需要单独评估该流程;并非所有 POST 目标都承担相同任务。

分别保留读取与提交的检查。本指南不改变 Jincheng 已发布的重定向,也不声称使用 308 能改善排名。例子的结论更具体:地址正确、最终响应正常,仍不足以验证到达的操作本身。

FUENTES Y NOTAS EDITORIALES

Fuentes y método

  1. IETF: RFC 9110, HTTP Semantics, sections 15.4.2 and 15.4.9 ↗
  2. Google: Redirects and Google Search ↗

Fuentes consultadas el 30 de noviembre de 2026. Los casos y datos numéricos de los ejercicios son ficticios. Editorial standards · Disclosures.