Skip to main content

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

  1. Use final URL after redirects as canonical crawl surface for structure validation.
  2. Parse URL components from raw final URL string (scheme, host, path, query, fragment).
  3. Evaluate path quality rules:
    • Path letters must be lowercase.
    • Word separators should use hyphens, not underscores or spaces.
    • Avoid encoded whitespace in path.
  4. Build normalized path candidate by lowercasing and converting underscore/space separators to hyphen for comparison only.
  5. Flag structure issue when actual path differs from policy-compliant normalized form.
  6. Record exact violations by token type (uppercase segment, underscore, encoded space, mixed separators).
  7. Do not infer meaning from client-side routes; validate only server-returned final URL string.

What to store

FieldTypeComment
page_url TEXTTEXTOriginal requested URL.
final_url TEXTTEXTRedirect-resolved final URL used for validation.
final_url_path TEXTTEXTPath component extracted from final URL.
url_path_is_lowercase BOOLEANBOOLEANWhether path contains only lowercase letters where applicable.
url_path_uses_hyphens BOOLEANBOOLEANWhether separators are hyphens instead of underscores/spaces.
url_path_has_encoded_space BOOLEANBOOLEANWhether path includes encoded whitespace sequences.
url_structure_is_clean BOOLEANBOOLEANOverall compliance result for lowercase-hyphen rule set.
url_structure_violations JSONBJSONBDetailed list of detected path formatting violations.
url_structure_checked_at TIMESTAMPTZTIMESTAMPTZTimestamp 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."
  • 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."
  • 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."

Sources

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.