url-structure

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

SEO 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
.claude/product-marketing-context.md
or
.cursor/product-marketing-context.md
exists, read it for site structure.
Identify:
  1. Site structure: Categories, subcategories, content types
  2. Current URLs: Existing patterns and issues
  3. Multi-language: URL structure for zh/en (e.g., /zh/, /en/ or subdomains)
优先检查产品营销上下文:如果存在
.claude/product-marketing-context.md
.cursor/product-marketing-context.md
文件,读取文件内容了解站点结构。
确认以下信息:
  1. 站点结构:分类、子分类、内容类型
  2. 现有URL:当前的命名规则和存在的问题
  3. 多语言:中/英文URL结构(例如/zh/、/en/路径或子域名)

Best Practices

最佳实践

URL Guidelines

URL设计准则

PrincipleGuideline
ReadableUse words, not IDs;
/blog/seo-guide
not
/p/12345
ShortShorter is generally better; avoid unnecessary depth
KeywordInclude target keyword when natural
LowercaseUse lowercase; avoid mixed case
HyphensUse hyphens to separate words:
seo-guide
AvoidSpecial chars, query params for core content, session IDs
原则准则
可读性使用实际词汇而非ID;采用
/blog/seo-guide
而非
/p/12345
简洁性通常越短越好;避免不必要的层级
关键词自然植入目标关键词
全小写使用小写字母;避免大小写混合
连字符分隔使用连字符分隔单词:例如
seo-guide
禁用内容特殊字符、核心内容的查询参数、会话ID

Hierarchy

层级设计

PatternExampleUse
Flat
/page-name
Simple sites
Category
/blog/post-name
,
/tools/tool-name
Content sites
Nested
/category/subcategory/page
Deep hierarchies (keep shallow)
模式示例适用场景
扁平结构
/page-name
小型简单站点
分类结构
/blog/post-name
/tools/tool-name
内容站点
嵌套结构
/category/subcategory/page
深层级站点(尽量保持层级较浅)

Multi-language

多语言方案

PatternExample
Path prefix
/zh/page
,
/en/page
Subdomain
zh.example.com
,
en.example.com
ccTLD
example.cn
,
example.com
模式示例
路径前缀
/zh/page
/en/page
子域名
zh.example.com
en.example.com
国家顶级域名
example.cn
example.com

Static vs Dynamic vs Pseudo-Static URLs

静态、动态与伪静态URL

TypeExampleUse
Static
/blog/seo-guide
Direct file; best SEO; content stable
Dynamic
/product?id=123
Program-generated; avoid for indexable content
Pseudo-static
/blog/seo-guide
(rewritten from
.php
)
Combines both; common in CMS
RulePrefer static or pseudo-static; if dynamic, keep params ≤2; use canonical-tag and robots-txt (Clean-param)
类型示例适用场景
静态URL
/blog/seo-guide
直接文件访问;SEO效果最佳;内容稳定
动态URL
/product?id=123
程序生成内容;可索引内容尽量避免使用
伪静态URL
/blog/seo-guide
(从
.php
重写而来)
结合两者优势;CMS系统中常见
规则优先使用静态或伪静态URL;如果使用动态URL,参数不超过2个;配合使用canonical-tagrobots-txt(Clean-param规则)

File Extensions

文件扩展名

  • Omit
    .html
    ,
    .php
    ,
    .aspx
    — keeps URLs technology-agnostic, shorter, easier to refactor
  • Example:
    /seo-guide
    not
    /seo-guide.html
  • 省略
    .html
    .php
    .aspx
    等后缀——让URL不绑定技术栈、更短、更易重构
  • 示例:采用
    /seo-guide
    而非
    /seo-guide.html

URL Parameter Handling

URL参数处理

ScenarioApproach
UTM / trackingCanonical to base URL; params in query string only
Search resultsCanonical to search page; avoid indexing result URLs
Filters / sortCanonical to base; or robots-txt Clean-param
Session IDsUse cookies; never in indexable URLs
场景处理方案
UTM/追踪参数canonical指向基础URL;仅在查询字符串中携带参数
搜索结果页canonical指向搜索首页;避免索引搜索结果URL
筛选/排序参数canonical指向基础URL;或配置robots-txt的Clean-param规则
会话ID使用cookie存储;绝对不要出现在可索引URL中

Use Cases

适用场景

ScenarioFocus
New sitePlan hierarchy upfront; avoid later restructuring
Migration301 mapping; canonical; see canonical-tag
Large siteDynamic URLs, params, multi-language — canonical + robots
SEO auditCheck structure, params, canonical consistency
场景核心关注项
新站点建设提前规划层级;避免后续重构
站点迁移301跳转映射;canonical配置;参考canonical-tag
大型站点动态URL、参数、多语言场景——canonical+robots配置
SEO审计检查结构、参数、canonical一致性

Common Issues

常见问题

IssueFix
Long URLsShorten; remove redundant words
Dynamic paramsUse canonical; clean params in robots (Yandex Clean-param)
Mixed caseRedirect to lowercase
Changed URLs301 redirect old to new
问题修复方案
URL过长缩短长度;删除冗余词汇
动态参数过多使用canonical;在robots中配置Clean-param规则(Yandex Clean-param)
大小写混合301跳转到小写URL
URL变更旧URL 301重定向到新URL

Output Format

输出格式

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结构会影响内链模式