Incorrect Controller Names Cause CodeIgniter 404s
It’s just a convention, right?
WRONG!
Due to the way Windows and Linux servers treat capital letters, you could be opening yourself up for a world of deployment pain or system moves if you have mixed landscapes.
What’s The Convention?
Capitalise the first letter. All others lowercase.
Examples:
- Home
- Aboutus
- Mymenus
- Contactme
Now, there’s the temptation on two-word controller names to capitalise the first letter of the second word. For example:
- AboutUs
- ContactUs
I’ll be honest, I’d personally like to do that but… DON’T!
Windows it’ll all be fine. Linux servers will start showing 404 pages. This is certainly a frustrating error to debug and by keeping to the convention of only capitalising the first letter of the controller – no matter how many words are in the controller name – you’ll save yourself a world of pain!