Search code examples
mod-rewritesearch-engineurl

Should we check slugs passed in URLS or just use the ID?


For example, if you access this url :Hidden features of mod_rewrite and this one Hidden features of mod_rewrite. It goes right to the same page, and it seems Stackoverflow doesn't check for a valid slug (as wordpress calls it).


Solution

  • I'd use just the ID as the slug may change but you'd still want old links to work.

    For example, if someone edited the title of their question you'd want to change the slug appropriately, but you wouldn't want old links to the question to stop working.