url-structure
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSEO On-Page: URL Structure
页面SEO:URL结构
Guides URL structure optimization for SEO: readability, hierarchy, and best practices.
When invoking: On first use, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.
面向SEO的URL结构优化指南:涵盖可读性、层级设计及最佳实践。
调用规则:首次使用时,如果合适,可以先用1-2句话介绍本技能的覆盖范围及重要性,再提供核心输出。后续使用或用户要求跳过介绍时,直接输出核心内容即可。
Scope (On-Page SEO)
适用范围(页面SEO)
- URL hierarchy: Path structure, categories, depth
- URL format: Static vs dynamic; omit file extensions
- URL slug: See url-slug-generator for slug creation (3–5 words, under 60 chars)
- Duplicate variants: See canonical-tag for HTTPS, www, trailing slash
- URL层级:路径结构、分类、深度
- URL格式:静态 vs 动态;省略文件扩展名
- URL slug:slug生成请参考url-slug-generator(3-5个词,不超过60字符)
- 重复变体:HTTPS、www、尾部斜杠问题请参考canonical-tag
Initial Assessment
初步评估
Check for product marketing context first: If or exists, read it for site structure.
.claude/product-marketing-context.md.cursor/product-marketing-context.mdIdentify:
- Site structure: Categories, subcategories, content types
- Current URLs: Existing patterns and issues
- Multi-language: URL structure for zh/en (e.g., /zh/, /en/ or subdomains)
优先检查产品营销上下文:如果存在或文件,读取文件内容了解站点结构。
.claude/product-marketing-context.md.cursor/product-marketing-context.md确认以下信息:
- 站点结构:分类、子分类、内容类型
- 现有URL:当前的命名规则和存在的问题
- 多语言:中/英文URL结构(例如/zh/、/en/路径或子域名)
Best Practices
最佳实践
URL Guidelines
URL设计准则
| Principle | Guideline |
|---|---|
| Readable | Use words, not IDs; |
| Short | Shorter is generally better; avoid unnecessary depth |
| Keyword | Include target keyword when natural |
| Lowercase | Use lowercase; avoid mixed case |
| Hyphens | Use hyphens to separate words: |
| Avoid | Special chars, query params for core content, session IDs |
| 原则 | 准则 |
|---|---|
| 可读性 | 使用实际词汇而非ID;采用 |
| 简洁性 | 通常越短越好;避免不必要的层级 |
| 关键词 | 自然植入目标关键词 |
| 全小写 | 使用小写字母;避免大小写混合 |
| 连字符分隔 | 使用连字符分隔单词:例如 |
| 禁用内容 | 特殊字符、核心内容的查询参数、会话ID |
Hierarchy
层级设计
| Pattern | Example | Use |
|---|---|---|
| Flat | | Simple sites |
| Category | | Content sites |
| Nested | | Deep hierarchies (keep shallow) |
| 模式 | 示例 | 适用场景 |
|---|---|---|
| 扁平结构 | | 小型简单站点 |
| 分类结构 | | 内容站点 |
| 嵌套结构 | | 深层级站点(尽量保持层级较浅) |
Multi-language
多语言方案
| Pattern | Example |
|---|---|
| Path prefix | |
| Subdomain | |
| ccTLD | |
| 模式 | 示例 |
|---|---|
| 路径前缀 | |
| 子域名 | |
| 国家顶级域名 | |
Static vs Dynamic vs Pseudo-Static URLs
静态、动态与伪静态URL
| Type | Example | Use |
|---|---|---|
| Static | | Direct file; best SEO; content stable |
| Dynamic | | Program-generated; avoid for indexable content |
| Pseudo-static | | Combines both; common in CMS |
| Rule | Prefer static or pseudo-static; if dynamic, keep params ≤2; use canonical-tag and robots-txt (Clean-param) |
| 类型 | 示例 | 适用场景 |
|---|---|---|
| 静态URL | | 直接文件访问;SEO效果最佳;内容稳定 |
| 动态URL | | 程序生成内容;可索引内容尽量避免使用 |
| 伪静态URL | | 结合两者优势;CMS系统中常见 |
| 规则 | 优先使用静态或伪静态URL;如果使用动态URL,参数不超过2个;配合使用canonical-tag和robots-txt(Clean-param规则) |
File Extensions
文件扩展名
- Omit ,
.html,.php— keeps URLs technology-agnostic, shorter, easier to refactor.aspx - Example: not
/seo-guide/seo-guide.html
- 省略、
.html、.php等后缀——让URL不绑定技术栈、更短、更易重构.aspx - 示例:采用而非
/seo-guide/seo-guide.html
URL Parameter Handling
URL参数处理
| Scenario | Approach |
|---|---|
| UTM / tracking | Canonical to base URL; params in query string only |
| Search results | Canonical to search page; avoid indexing result URLs |
| Filters / sort | Canonical to base; or robots-txt Clean-param |
| Session IDs | Use cookies; never in indexable URLs |
| 场景 | 处理方案 |
|---|---|
| UTM/追踪参数 | canonical指向基础URL;仅在查询字符串中携带参数 |
| 搜索结果页 | canonical指向搜索首页;避免索引搜索结果URL |
| 筛选/排序参数 | canonical指向基础URL;或配置robots-txt的Clean-param规则 |
| 会话ID | 使用cookie存储;绝对不要出现在可索引URL中 |
Use Cases
适用场景
| Scenario | Focus |
|---|---|
| New site | Plan hierarchy upfront; avoid later restructuring |
| Migration | 301 mapping; canonical; see canonical-tag |
| Large site | Dynamic URLs, params, multi-language — canonical + robots |
| SEO audit | Check structure, params, canonical consistency |
| 场景 | 核心关注项 |
|---|---|
| 新站点建设 | 提前规划层级;避免后续重构 |
| 站点迁移 | 301跳转映射;canonical配置;参考canonical-tag |
| 大型站点 | 动态URL、参数、多语言场景——canonical+robots配置 |
| SEO审计 | 检查结构、参数、canonical一致性 |
Common Issues
常见问题
| Issue | Fix |
|---|---|
| Long URLs | Shorten; remove redundant words |
| Dynamic params | Use canonical; clean params in robots (Yandex Clean-param) |
| Mixed case | Redirect to lowercase |
| Changed URLs | 301 redirect old to new |
| 问题 | 修复方案 |
|---|---|
| URL过长 | 缩短长度;删除冗余词汇 |
| 动态参数过多 | 使用canonical;在robots中配置Clean-param规则(Yandex Clean-param) |
| 大小写混合 | 301跳转到小写URL |
| URL变更 | 旧URL 301重定向到新URL |
Output Format
输出格式
- URL structure recommendation
- Slug conventions
- Hierarchy for key content types
- Redirect plan if changing URLs
- References: Alignify URL optimization; Google URL guidelines
- URL结构建议
- Slug命名规范
- 核心内容类型的层级设计
- URL变更时的重定向方案
- 参考资料:Alignify URL优化指南;Google URL设计规范
Related Skills
相关技能
-
website-structure: Plan structure and URL paths; apply url-structure rules after structure is defined
-
canonical-tag: HTTPS, www, trailing slash — handles duplicate URL variants
-
url-slug-generator: Slug creation for content pages; length, keywords, format
-
category-page-generator: E-commerce category URL hierarchy, faceted URLs
-
products-page-generator: Product URL hierarchy
-
services-page-generator: Service URL hierarchy
-
robots-txt: Clean-param for query params
-
internal-links: URL structure affects link patterns
-
website-structure:规划站点结构和URL路径;结构确定后应用本URL结构规则
-
canonical-tag:处理HTTPS、www、尾部斜杠等重复URL变体问题
-
url-slug-generator:内容页slug生成;涵盖长度、关键词、格式要求
-
category-page-generator:电商分类URL层级、分面URL设计
-
products-page-generator:产品页URL层级设计
-
services-page-generator:服务页URL层级设计
-
robots-txt:查询参数的Clean-param规则配置
-
internal-links:URL结构会影响内链模式