{"id":2702,"date":"2019-12-01T16:12:59","date_gmt":"2019-12-01T16:12:59","guid":{"rendered":"http:\/\/www.dpscomputing.com\/blog\/?p=2702"},"modified":"2021-03-01T21:33:05","modified_gmt":"2021-03-01T21:33:05","slug":"incorrect-controller-names-cause-codeigniter-404s","status":"publish","type":"post","link":"https:\/\/www.dpscomputing.com\/blog\/2019\/12\/01\/incorrect-controller-names-cause-codeigniter-404s\/","title":{"rendered":"Incorrect Controller Names Cause CodeIgniter 404s"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"alignright size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2703\" data-permalink=\"https:\/\/www.dpscomputing.com\/blog\/2019\/12\/01\/incorrect-controller-names-cause-codeigniter-404s\/codeigniter-2\/\" data-orig-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/12\/codeigniter.jpg\" data-orig-size=\"866,650\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"codeigniter\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/12\/codeigniter-300x225.jpg\" data-large-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/12\/codeigniter.jpg\" tabindex=\"0\" role=\"button\" src=\"http:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/12\/codeigniter.jpg\" alt=\"CodeIgniter\" class=\"wp-image-2703\" width=\"433\" height=\"325\" srcset=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/12\/codeigniter.jpg 866w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/12\/codeigniter-300x225.jpg 300w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/12\/codeigniter-150x113.jpg 150w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/12\/codeigniter-768x576.jpg 768w\" sizes=\"auto, (max-width: 433px) 100vw, 433px\" \/><\/figure><\/div>\n\n\n\n<p>It&#8217;s just a convention, right?  <\/p>\n\n\n\n<p>WRONG!<\/p>\n\n\n\n<p>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.  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s The Convention?<\/h2>\n\n\n\n<p>Capitalise the first letter.  All others lowercase.  <\/p>\n\n\n\n<p>Examples:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Home<\/li><li>Aboutus<\/li><li>Mymenus<\/li><li>Contactme<\/li><\/ol>\n\n\n\n<p>Now, there&#8217;s the temptation on two-word controller names to capitalise the first letter of the second word.  For example:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>AboutUs<\/li><li>ContactUs<\/li><\/ol>\n\n\n\n<p>I&#8217;ll be honest, I&#8217;d personally like to do that but&#8230; DON&#8217;T!<\/p>\n\n\n\n<p>Windows it&#8217;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 &#8211; no matter how many words are in the controller name &#8211; you&#8217;ll save yourself a world of pain!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;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&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2703,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Incorrect Controller Names Cause CodeIgniter 404s\n\nOver capitalisation leads to a world of pain.  It's not just a convention, it's a requirement!  \n\nCheck you're not falling into the trap now!","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[2139],"tags":[2515,2506,2514,2512,2513],"class_list":["post-2702","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development-issues","tag-404-error-codeigniter","tag-codeigniter","tag-codeigniter-controller-404","tag-codeigniter-controller-names","tag-codeigniter-naming-conventions"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/12\/codeigniter.jpg","jetpack_shortlink":"https:\/\/wp.me\/p3nsfA-HA","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/2702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/comments?post=2702"}],"version-history":[{"count":2,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/2702\/revisions"}],"predecessor-version":[{"id":3026,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/2702\/revisions\/3026"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/media\/2703"}],"wp:attachment":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/media?parent=2702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/categories?post=2702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/tags?post=2702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}