Url structure skill

When the user wants to optimize URL structure, fix URL issues, or plan URL hierarchy.

by kostja94·MIT license·★ 1,006 Stars on the repo·GitHub ↗

Use now

Files of Url structure

kostja94/main1 file shown
SKILL.md
Show the full text119 lines

SEO On-Page: URL Structure

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.

Scope (On-Page 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

Initial Assessment

Project context: Read root contextus.md when present and load only the modules relevant to this task. Without Contextus, use available project material or user-provided facts and ask for missing information; do not create a parallel context system.

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)

Best Practices

URL Guidelines
Principle Guideline
Readable Use words, not IDs; /blog/seo-guide not /p/12345
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: seo-guide
Avoid Special chars, query params for core content, session IDs
Hierarchy
Pattern Example Use
Flat /page-name Simple sites
Category /blog/post-name, /tools/tool-name Content sites
Nested /category/subcategory/page Deep hierarchies (keep shallow)
Multi-language
Pattern Example
Path prefix /zh/page, /en/page
Subdomain zh.example.com, en.example.com
ccTLD example.cn, example.com
Static vs Dynamic vs Pseudo-Static URLs
Type Example Use
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
Rule Prefer static or pseudo-static; if dynamic, keep params ≤2; use canonical-tag and robots-txt (Clean-param)
File Extensions
  • Omit .html, .php, .aspx — keeps URLs technology-agnostic, shorter, easier to refactor
  • Example: /seo-guide not /seo-guide.html
URL Parameter Handling
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
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

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

Output Format

  • 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

1---
2name: url-structure
3description: When the user wants to optimize URL structure, fix URL issues, or plan URL hierarchy. Also use when the user mentions "URL structure," "URL optimization," "slug," "clean URLs," "URL hierarchy," "URL path," "permalink structure," "URL best practices," "dynamic URLs," or "URL parameters." For per-page slug wording, use url-slug-generator. For canonical consolidation, use canonical-tag.
4metadata:
5 version: 1.1.0
6---
7 
8# SEO On-Page: URL Structure
9 
10Guides URL structure optimization for SEO: readability, hierarchy, and best practices.
11 
12**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.
13 
14## Scope (On-Page SEO)
15 
16- **URL hierarchy**: Path structure, categories, depth
17- **URL format**: Static vs dynamic; omit file extensions
18- **URL slug**: See **url-slug-generator** for slug creation (3–5 words, under 60 chars)
19- **Duplicate variants**: See **canonical-tag** for HTTPS, www, trailing slash
20 
21## Initial Assessment
22 
23**Project context:** Read root `contextus.md` when present and load only the modules relevant to this task. Without Contextus, use available project material or user-provided facts and ask for missing information; do not create a parallel context system.
24 
25Identify:
261. **Site structure**: Categories, subcategories, content types
272. **Current URLs**: Existing patterns and issues
283. **Multi-language**: URL structure for zh/en (e.g., /zh/, /en/ or subdomains)
29 
30## Best Practices
31 
32### URL Guidelines
33 
34| Principle | Guideline |
35|-----------|-----------|
36| **Readable** | Use words, not IDs; `/blog/seo-guide` not `/p/12345` |
37| **Short** | Shorter is generally better; avoid unnecessary depth |
38| **Keyword** | Include target keyword when natural |
39| **Lowercase** | Use lowercase; avoid mixed case |
40| **Hyphens** | Use hyphens to separate words: `seo-guide` |
41| **Avoid** | Special chars, query params for core content, session IDs |
42 
43### Hierarchy
44 
45| Pattern | Example | Use |
46|---------|---------|-----|
47| **Flat** | `/page-name` | Simple sites |
48| **Category** | `/blog/post-name`, `/tools/tool-name` | Content sites |
49| **Nested** | `/category/subcategory/page` | Deep hierarchies (keep shallow) |
50 
51### Multi-language
52 
53| Pattern | Example |
54|---------|---------|
55| **Path prefix** | `/zh/page`, `/en/page` |
56| **Subdomain** | `zh.example.com`, `en.example.com` |
57| **ccTLD** | `example.cn`, `example.com` |
58 
59### Static vs Dynamic vs Pseudo-Static URLs
60 
61| Type | Example | Use |
62|------|---------|-----|
63| **Static** | `/blog/seo-guide` | Direct file; best SEO; content stable |
64| **Dynamic** | `/product?id=123` | Program-generated; avoid for indexable content |
65| **Pseudo-static** | `/blog/seo-guide` (rewritten from `.php`) | Combines both; common in CMS |
66| **Rule** | Prefer static or pseudo-static; if dynamic, keep params ≤2; use **canonical-tag** and **robots-txt** (Clean-param) |
67 
68### File Extensions
69 
70- **Omit** `.html`, `.php`, `.aspx` — keeps URLs technology-agnostic, shorter, easier to refactor
71- **Example**: `/seo-guide` not `/seo-guide.html`
72 
73### URL Parameter Handling
74 
75| Scenario | Approach |
76|----------|----------|
77| **UTM / tracking** | Canonical to base URL; params in query string only |
78| **Search results** | Canonical to search page; avoid indexing result URLs |
79| **Filters / sort** | Canonical to base; or **robots-txt** Clean-param |
80| **Session IDs** | Use cookies; never in indexable URLs |
81 
82### Use Cases
83 
84| Scenario | Focus |
85|----------|-------|
86| **New site** | Plan hierarchy upfront; avoid later restructuring |
87| **Migration** | 301 mapping; canonical; see **canonical-tag** |
88| **Large site** | Dynamic URLs, params, multi-language — canonical + robots |
89| **SEO audit** | Check structure, params, canonical consistency |
90 
91## Common Issues
92 
93| Issue | Fix |
94|-------|-----|
95| Long URLs | Shorten; remove redundant words |
96| Dynamic params | Use canonical; clean params in robots (Yandex Clean-param) |
97| Mixed case | Redirect to lowercase |
98| Changed URLs | 301 redirect old to new |
99 
100## Output Format
101 
102- **URL structure** recommendation
103- **Slug** conventions
104- **Hierarchy** for key content types
105- **Redirect** plan if changing URLs
106- **References**: [Alignify URL optimization](https://alignify.co/zh/seo/url-optimization); [Google URL guidelines](https://developers.google.com/search/docs/crawling-indexing/url-structure)
107 
108## Related Skills
109 
110- **website-structure**: Plan structure and URL paths; apply url-structure rules after structure is defined
111 
112- **canonical-tag**: HTTPS, www, trailing slash — handles duplicate URL variants
113- **url-slug-generator**: Slug creation for content pages; length, keywords, format
114- **category-page-generator**: E-commerce category URL hierarchy, faceted URLs
115- **products-page-generator**: Product URL hierarchy
116- **services-page-generator**: Service URL hierarchy
117- **robots-txt**: Clean-param for query params
118- **internal-links**: URL structure affects link patterns
119 

Discussion