0

When I create an image using http://bayimg.com, I get a URL such as http://bayimg.com/NANmnAaCJ, and the image is hosted at http://image.bayimg.com/nanmnaacj.jpg.

I know that some URL shortening services use mixed case to get an extra 26 characters. However, that doesn't seem to be the case for bayimg.

Why is the URL in mixed case? Can I simply ignore the case and only keep the lowercase version (or is there some kind of hidden feature or future concern I need to worry about)?

2 Answers 2

6

bayimg.com is using lighthttpd to host its website. lighthttpd can be hosted both on Windows and Unix based operating systems. Typically for non Windows hosting, the case does matter. So 2 resources by 2 different URLs where only the case of the path differs could refer to 2 different resources.

Even if different case variations give you the same result, I'd not assume that they will always point to the same resource. Use the exact URL with casing that they give you.

You never know they may even have some computers hosting on Windows and others on a Unix based system. Maybe you just happen to hit one of their Windows servers via DNS load balancing.

There is mention in RFC1738 - Uniform Resource Locators (URL) that the scheme should be case insensitive (example: HTTP://), but there is no mention about the path of the URL, so don't assume 2 different cased URLs are the same, even if they happen to point to the same resource for you on your test.

2
  • I remember reading that domain names are also case-insensitive, but URL paths are (or at least are supposed to be) case-sensitive. Not sure where I read it, though - it might have been the HTTP spec.
    – David Z
    Commented Jul 12, 2010 at 9:13
  • The point is that they don't really give you the URL. I think the only way is to right-click and view the image's source. Which will then give you a lowercase version of the URL. I guess, though, that this is probably the one they want you to use.
    – Senseful
    Commented Jul 14, 2010 at 15:17
2

Why don't you try changing the case in an existing URL and see if you still get the same image?

From trying it just now, it looks like the answer is that the page URLs are case-insensitive and the image URLs are case-sensitive. However, unless this is documented anywhere, they have every right to change it and break your assumption. (I suppose they have the right to do it even if it's documented, but it's not very nice).

Just use the URL as they provide it and you'll probably be alright.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.