tarquino Posted December 27, 2014 Share Posted December 27, 2014 i am trying to understand, how a site like ebay can display content and be case insensitive?for example: The original url: http://www.ebay.co.uk/itm/Toshiba-Satellite-C50-AMD-E-Series-1-4GHz-Dual-Core-15-6-Inch-500GB-2GB-Laptop/151458954958 the above works fine and go to the intended page.user editing the browser url into lowercase : http://www.ebay.co.uk/itm/toshiba-satellite-c50-amd-e-series-1-4ghz-dual-core-15-6-inch-500gb-2GB-laptop/151458954958 random uppercase and lowercase. http://www.ebay.co.uk/itm/toshiba-sateLLite-c50-aMd-e-sERIes-1-4ghz-dual-core-15-6-inch-500gb-2GB-laptop/151458954958 both the urls above also work fine and go to the intended page. How can such a thing can work? it is supposed to throw an error such as page not found and the like?any thoughts welcome. Quote Link to comment https://forums.phpfreaks.com/topic/293379-url-question/ Share on other sites More sharing options...
requinix Posted December 27, 2014 Share Posted December 27, 2014 It will do whatever it wants to do. Apparently eBay doesn't care about case-sensitivity, and I bet it doesn't care about the label at all - just the number at the end. Quote Link to comment https://forums.phpfreaks.com/topic/293379-url-question/#findComment-1500814 Share on other sites More sharing options...
QuickOldCar Posted December 27, 2014 Share Posted December 27, 2014 (edited) Everything in a url is case sensitive, browsers will lower the domains though. So if is a path/folder/file should always do them proper case. What you see there is not a real location but added into the url for seo purposes, as requinix said they probably just use the id. Could be a fancy rewrite rule and the url could look something like this http://www.ebay.co.uk/?itm=toshiba-satellite-c50-amd-e-series-1-4ghz-dual-core-15-6-inch-500gb-2GB-laptop&id=151458954958 The parameters would be able to be uppercased for display and lowercased for usage. Edit: Yes this works the same http://www.ebay.co.uk/itm/151458954958 Edited December 27, 2014 by QuickOldCar Quote Link to comment https://forums.phpfreaks.com/topic/293379-url-question/#findComment-1500822 Share on other sites More sharing options...
tarquino Posted January 2, 2015 Author Share Posted January 2, 2015 how do they manage to do so? do they use htaccess redirects and the like? or is this down to something else? Quote Link to comment https://forums.phpfreaks.com/topic/293379-url-question/#findComment-1501540 Share on other sites More sharing options...
requinix Posted January 2, 2015 Share Posted January 2, 2015 They use URL rewriting. Exactly how depends on the servers they use in the background: Apache or IIS or nginx or whatever. Quote Link to comment https://forums.phpfreaks.com/topic/293379-url-question/#findComment-1501554 Share on other sites More sharing options...
brotherZ Posted February 12, 2015 Share Posted February 12, 2015 It's all in .htaccess where the URL rewriting is coded. You can do anything in the .htaccess, such as changing all the characters in the URL to lower case before attempting to do the matching and rewriting. Quote Link to comment https://forums.phpfreaks.com/topic/293379-url-question/#findComment-1505555 Share on other sites More sharing options...
CroNiX Posted February 12, 2015 Share Posted February 12, 2015 It's also possible they just store their urls as lower case strings in the db and force the requested URL to lowercase to get a match? Quote Link to comment https://forums.phpfreaks.com/topic/293379-url-question/#findComment-1505561 Share on other sites More sharing options...
CroNiX Posted February 12, 2015 Share Posted February 12, 2015 (edited) But I believe Requinix is correct and they are going by the ID at the end. http://www.ebay.co.uk/itm/some-crap-here/151458954958 loads the same content as the original. http://www.ebay.co.uk/itm/Toshiba-Satellite-C50-AMD-E-Series-1-4GHz-Dual-Core-15-6-Inch-500GB-2GB-Laptop/151458954958 Edited February 12, 2015 by CroNiX Quote Link to comment https://forums.phpfreaks.com/topic/293379-url-question/#findComment-1505562 Share on other sites More sharing options...
jeffreyappel Posted February 23, 2015 Share Posted February 23, 2015 People create uppercase or mix case URLs mainly for branding or SEO purpose.Sometimes they do this for better readability.Generally it should throw exceptions while user request with URLs not matching the case. But this is avoided by adding some rules in either in .htaccess file or using RewriteMap in httpd.conf^.Second one is less complex and works faster. Quote Link to comment https://forums.phpfreaks.com/topic/293379-url-question/#findComment-1506525 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.