301

Moved Permanently

개요

301 Moved Permanently는 리소스가 새 URL로 영구히 이동했음을 알리고, 새 위치를 Location 헤더로 제공합니다. 브라우저와 검색엔진은 이를 영구 이전으로 이해해, 이후 요청을 새 URL로 보내고 링크 자산(랭킹·평판)을 새 주소로 옮깁니다.

SEO 관점에서 도메인 이전, HTTP→HTTPS 전환, URL 구조 변경 시 가장 표준적인 도구이며, 오래 유지될수록 검색 색인이 새 URL로 안정적으로 갱신됩니다.

언제 발생하나

요청 / 응답 예시

요청
GET /old-page HTTP/1.1
Host: example.com
응답
HTTP/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');
});

실무 참고

관련 상태코드

관련 헤더

스펙 근거