301 Moved Permanently는 리소스가 새 URL로 영구히 이동했음을 알리고, 새 위치를 Location 헤더로 제공합니다. 브라우저와 검색엔진은 이를 영구 이전으로 이해해, 이후 요청을 새 URL로 보내고 링크 자산(랭킹·평판)을 새 주소로 옮깁니다.
SEO 관점에서 도메인 이전, HTTP→HTTPS 전환, URL 구조 변경 시 가장 표준적인 도구이며, 오래 유지될수록 검색 색인이 새 URL로 안정적으로 갱신됩니다.
GET /old-page HTTP/1.1
Host: example.comHTTP/1.1 301 Moved Permanently
Location: https://example.com/new-page
Content-Type: text/html
<h1>Moved Permanently</h1><p>The document has moved <a href="/new-page">here</a>.</p>location = /old-page {
return 301 /new-page;
}
# force https + non-www
server { return 301 https://example.com$request_uri; }app.get('/old-page', (req, res) => {
res.redirect(301, '/new-page');
});