Welcome Guest, Not a member yet? Register   Sign In
URL case issue - why does /mycontroller work but /Mycontroller doesn't?
#1

[eluser]kaosweaver[/eluser]
Well, the title pretty much covers it.

I understand I can force lower case with a well written htaccess, however, the powers that be believe this solution to seem "sub par" and to "suck"

Essentially, a base install of CI 2.1.x on a *nix platform, we have people in the company saying they typed in our development url "www.us.com/News" instead of "www.us.com/news" and it doesn't work.

I've attempted to search for case sensitive issues to little avail (again, most solutions are htaccess based).

So, I'm wondering why it is setup this way and if it can be changed with a hook or something to route to the right controller, regardless of the case of the URL?
#2

[eluser]CroNiX[/eluser]
http://www.w3.org/TR/WD-html40-970708/htmlweb.html
Quote:URLs in general are case-sensitive (with the exception of machine names). There may be URLs, or parts of URLs, where case doesn't matter, but identifying these may not be easy. Users should always consider that URLs are case-sensitive.
#3

[eluser]pickupman[/eluser]
Add to /application/config/routes.php
Code:
$route['News'] = 'news';
#4

[eluser]CroNiX[/eluser]
And if they type NEws, NEWs, NEWS?

Going to be a lot of work to idiotproof that...for all controllers and for all possible combinations, unless you use case-insensitive regex there.

Then there's methods to consider Smile

Extra parameters (segments 3+) shouldn't be affected by case though.
#5

[eluser]kaosweaver[/eluser]
[quote author="CroNiX" date="1348000733"]http://www.w3.org/TR/WD-html40-970708/htmlweb.html
Quote:URLs in general are case-sensitive (with the exception of machine names). There may be URLs, or parts of URLs, where case doesn't matter, but identifying these may not be easy. Users should always consider that URLs are case-sensitive.
[/quote]

Thanks, this helps me seek the htaccess, regexp solution I think will do what they want (and takes the "blame" off of CI)




Theme © iAndrew 2016 - Forum software by © MyBB