Loading...
Loading...
Compare original and translation side by side
.claude/product-marketing-context.md.cursor/product-marketing-context.md.claude/product-marketing-context.md.cursor/product-marketing-context.md| Method | When | Strength |
|---|---|---|
| 301 redirect | Preferred; server can redirect | Strongest — permanent redirect |
| Canonical tag | Cannot redirect (e.g. params, pagination) | Strong — HTML signal |
| robots.txt | Block non-canonical paths | Weak — advisory only |
| 方法 | 适用场景 | 优势 |
|---|---|---|
| 301重定向 | 首选方案;服务器可执行重定向 | 最强效——永久重定向 |
| Canonical标签 | 无法执行重定向的场景(如参数、分页) | 效果显著——HTML层面的信号 |
| robots.txt | 屏蔽非规范路径 | 效果较弱——仅为建议性设置 |
| Rule | Note |
|---|---|
| Absolute URL | Include |
| Consistency | Must match current page URL or the chosen preferred version |
| No chains | A→B→C is invalid |
| 规则 | 说明 |
|---|---|
| 绝对URL | 需包含 |
| 一致性 | 必须与当前页面URL或选定的首选版本一致 |
| 禁止链式设置 | A→B→C的链式设置无效 |
export const metadata = {
alternates: {
canonical: "https://example.com/page-slug",
languages: {
zh: "https://example.com/zh/page-slug",
en: "https://example.com/page-slug",
"x-default": "https://example.com/page-slug",
},
},
};export const metadata = {
alternates: {
canonical: "https://example.com/page-slug",
languages: {
zh: "https://example.com/zh/page-slug",
en: "https://example.com/page-slug",
"x-default": "https://example.com/page-slug",
},
},
};<link rel="canonical" href="https://example.com/page-slug" /><link rel="canonical" href="https://example.com/page-slug" />RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]return 301 https://$host$request_uri;RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]return 301 https://$host$request_uri;