php - Making incorrect URL's default to database value -
imagine value in database - e.g. raquel_welch - represents page url (e.g. mysite/people/raquel_welch). imagine if types in url incorrectly, of following...
mysite/people/raquel welch mysite/people/raquel_welch mysite/people/raquel welch
in other words, url spelled correctly, letter case wrong and/or there's no underscore. rather fetch 404 error page, i'd url default proper url - mysite/people/raquel_welch
does know how this?
incidentally, wikipedia has similar feature; if type in url without underscore, default proper url, though doesn't appear work cases... http://en.wikipedia.org/wiki/raquel welch
rather automatically capitalize first letter of each word, think i'd prefer have url default value in database.
look key url case-and-underscore insensitively (this requires storing normalized version in db, instance lowercase , underscores), , if url doesn't match canonical version, send 301 redirect canonical path.
Comments
Post a Comment