Cowlby
Cowlby

Reputation: 651

Accept case-insensitive URL or redirect to "correct" URL?

Let's say that I have a web app that responds to URLs in the format /entities/{entityKey}. In my access logs, I find people visiting both /entities/KEY1 which is how app URLs are generated, as well as the lower case version of /entities/key1. Currently key1 will throw a 404 not found error due to route requirements.

My question is, would you:

  1. Use URL re-writing to re-write key to uppercase.
  2. Create 302 redirects from lowercase to uppercase?
  3. Have the application convert to uppercase and handle requests in a case-insensitive fashion

Upvotes: 0

Views: 135

Answers (1)

Dallin
Dallin

Reputation: 590

Most users these days expect URLs to be case-insensitive. I would have the app silently handle the conversion in the background. I don't see it being worth the extra request time to issue a redirect.

If SEO is a concern, then you can use the rel="canonical" meta tag to let google/other search engines know which URL you want to appear in search results.

Upvotes: 2

Related Questions