HTTP 301 — Moved Permanently
HTTP 301 is the permanent change-of-address notice: the resource lives at the URL in the Location header now, and clients — including search engines — should update their records and go there from now on.
When 301 shows up
- Migrating a site to a new domain or URL scheme.
- Consolidating duplicate pages so ranking signals point at one canonical URL.
Mocking a 301 response
A response with this status can be faked end to end with a local mock rule — no backend changes needed. The configuration below mirrors the rule fields the ApiSimul editor uses (method, path, status, delay in milliseconds, response body):
{
"method": "GET",
"path": "/old-blog/{{param.id}}",
"status": 301,
"delay": 150,
"enabled": true,
"body": null
}Dynamic placeholders such as {{random.name}}, {{string.uuid}} or {{number.int 1 100}} can appear inside the body to vary each response, which keeps client-side list rendering and retry logic honest during development.
Frequently asked questions
What does HTTP 301 mean?
The resource has permanently moved. Bookmarks, caches and crawlers should replace the old URL with the one in Location and need not ask again.
How can I test a 301 response without a real backend?
Define a mock rule with the method and path your client requests and set the status to 301. The example configuration above returns this response after the listed delay, so the client exercises its 301 handling exactly as it would against a live server.
Related status codes
Need the response in your own project? Spin up rules for any status with the ApiSimul mock server, or browse every status code page.