跳转到内容

重定向

指令语法
RedirectRedirect [status] url-path target-URL
RedirectMatchRedirectMatch [status] regex target-URL
ErrorDocumentErrorDocument error-code document
状态码含义
301永久移动
302已找到(默认)
303查看其他
410已删除
Redirect 301 /old-page /new-page
Redirect /temp-page /other-page
RedirectMatch 301 ^/blog/(.*)$ /articles/$1
RedirectMatch ^/category/(.+)/feed/?$ /rss/$1
ErrorDocument 404 /custom-404.html
ErrorDocument 403 "Access Denied"
ErrorDocument 500 https://example.com/error