URL structure clean (lowercase hyphens)
Issue No: 15
Category: page seo basics
Issue type: Warning
Priority: STANDARD
Description
Verify that crawled URLs follow clean formatting conventions using lowercase and hyphen-separated paths to avoid duplicate variants and improve URL readability.
How do we capture it
- Use final URL after redirects as canonical crawl surface for structure validation.
- Parse URL components from raw final URL string (scheme, host, path, query, fragment).
- Evaluate path quality rules:
- Path letters must be lowercase.
- Word separators should use hyphens, not underscores or spaces.
- Avoid encoded whitespace in path.
- Build normalized path candidate by lowercasing and converting underscore/space separators to hyphen for comparison only.
- Flag structure issue when actual path differs from policy-compliant normalized form.
- Record exact violations by token type (uppercase segment, underscore, encoded space, mixed separators).
- Do not infer meaning from client-side routes; validate only server-returned final URL string.
What to store
| Field | Type | Comment |
|---|---|---|
| page_url TEXT | TEXT | Original requested URL. |
| final_url TEXT | TEXT | Redirect-resolved final URL used for validation. |
| final_url_path TEXT | TEXT | Path component extracted from final URL. |
| url_path_is_lowercase BOOLEAN | BOOLEAN | Whether path contains only lowercase letters where applicable. |
| url_path_uses_hyphens BOOLEAN | BOOLEAN | Whether separators are hyphens instead of underscores/spaces. |
| url_path_has_encoded_space BOOLEAN | BOOLEAN | Whether path includes encoded whitespace sequences. |
| url_structure_is_clean BOOLEAN | BOOLEAN | Overall compliance result for lowercase-hyphen rule set. |
| url_structure_violations JSONB | JSONB | Detailed list of detected path formatting violations. |
| url_structure_checked_at TIMESTAMPTZ | TIMESTAMPTZ | Timestamp when URL structure check was computed. |
Condition for trigger
This audit triggers when path formatting violates lowercase-hyphen policy.
-
Trigger Rule 1: Uppercase Path Segment
- Target Field:
url_path_is_lowercase - Evaluation Logic:
url_path_is_lowercase = FALSE - Severity: SUGGESTION
- Diagnostic Message: "URL path contains uppercase characters; use lowercase for consistency."
- Target Field:
-
Trigger Rule 2: Non-Hyphen Separators
- Target Field:
url_path_uses_hyphens - Evaluation Logic:
url_path_uses_hyphens = FALSE - Severity: SUGGESTION
- Diagnostic Message: "URL path uses non-hyphen separators; use hyphens between words."
- Target Field:
-
Trigger Rule 3: URL Structure Not Clean
- Target Field:
url_structure_is_clean - Evaluation Logic:
url_structure_is_clean = FALSE - Severity: SUGGESTION
- Diagnostic Message: "URL structure does not meet lowercase-hyphen formatting policy."
- Target Field:
Sources
- Google URL Structure Best Practices: https://developers.google.com/search/docs/crawling-indexing/url-structure
- RFC 3986 URI Generic Syntax: https://www.rfc-editor.org/rfc/rfc3986
- MDN URL API: https://developer.mozilla.org/en-US/docs/Web/API/URL
Long description
URL consistency reduces duplicate crawl surfaces and improves maintainability across internal linking, sitemap generation, and analytics. Mixed casing and inconsistent separators can produce multiple distinct URLs from a crawler perspective even when content intent is the same. Standardizing to lowercase-hyphen paths makes canonicalization, deduplication, and reporting more predictable.
Common failure scenarios checked by the crawler:
- Uppercase letters appear in path segments.
- Underscores or encoded spaces appear instead of hyphens.
- Mixed separator styles produce inconsistent URL patterns.
- Redirects land on non-standard path formatting.
How to Fix
Adopt a site-wide URL policy that enforces lowercase and hyphen-separated paths. Apply normalization in route generation and content publishing workflows, then add permanent redirects from legacy variants to the preferred format. Ensure internal links and sitemaps point only to normalized URLs.