{"id":1076,"date":"2012-11-11T15:28:22","date_gmt":"2012-11-11T15:28:22","guid":{"rendered":"http:\/\/brain.payzip.co.kr\/?p=1076"},"modified":"2012-11-11T15:28:22","modified_gmt":"2012-11-11T15:28:22","slug":"codeigniter-index-php-%ec%a0%9c%ea%b1%b0%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/blog.goorigo.com\/?p=1076","title":{"rendered":"CodeIgniter index.php \uc81c\uac70\ud558\uae30"},"content":{"rendered":"<p>http:\/\/oozman.com\/php-tutorials\/remove-index-php-codeigniter-windows\/<\/p>\n<p>http:\/\/www.cikorea.net\/lecture\/view\/213\/page\/1<\/p>\n<p>&nbsp;<\/p>\n<p>Hi guys, just want to share with you this simple solution on how to remove index.php in your CodeIgniter\u2019s URL if you\u2019re using a server based in Windows. Like me, I develop most of my application using my Windows platform and sometimes, there are things that won\u2019t work on Windows but works perfectly on Linux\/UNIX platforms.<\/p>\n<p>And the best example of this scenario is the \u201chow to remove index.php in CodeIgniter\u201d. As you\u2019ve noticed, CodeIgniter does include the solution to this problem, but unfortunately, it won\u2019t work when you are using a server deployed in Windows. So, I\u2019m thinking that this will be useful with you as well.<\/p>\n<p>Here is the default solution given by CodeIgniter in there cool framework documentation:<br \/>\nYou should copy this code below to your .htaccess that must recide on your CI root directory.<\/p>\n<div>\n<ol start=\"1\">\n<li>RewriteEngine\u00a0on<\/li>\n<li>RewriteCond\u00a0$1\u00a0!^(index\\.php|images|robots\\.txt)<\/li>\n<li>RewriteRule\u00a0^(.*)$\u00a0\/index.php\/$1\u00a0[L]<\/li>\n<\/ol>\n<div><object width=\"0\" height=\"0\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"src\" value=\"http:\/\/oozman.com\/wp-content\/plugins\/google-syntax-highlighter\/Scripts\/clipboard.swf\" \/><param name=\"flashvars\" value=\"clipboard=RewriteEngine%20on%0ARewriteCond%20%241%20!%5E(index%5C.php%7Cimages%7Crobots%5C.txt)%0ARewriteRule%20%5E(.*)%24%20%2Findex.php%2F%241%20%5BL%5D%0A\" \/><embed width=\"0\" height=\"0\" type=\"application\/x-shockwave-flash\" src=\"http:\/\/oozman.com\/wp-content\/plugins\/google-syntax-highlighter\/Scripts\/clipboard.swf\" flashvars=\"clipboard=RewriteEngine%20on%0ARewriteCond%20%241%20!%5E(index%5C.php%7Cimages%7Crobots%5C.txt)%0ARewriteRule%20%5E(.*)%24%20%2Findex.php%2F%241%20%5BL%5D%0A\" \/><\/object><\/div>\n<\/div>\n<p>But, as I said, this won\u2019t work on Windows, except if you\u2019re running on a server deployed using Linux\/UNIX.<\/p>\n<p>So, to make things work\u00a0on Windows. You can check this working solution that I personally used. It has some additional steps, but it\u2019s super easy to do.<\/p>\n<p><strong>Step 1:<\/strong><br \/>\nCreate a .htaccess file\u00a0<em>(in your CI root folder)<\/em>\u00a0and copy this code below.<\/p>\n<div>\n<ol start=\"1\">\n<li>RewriteEngine\u00a0On<\/li>\n<li>RewriteBase\u00a0\/YOUR-CI-ROOT-FOLDER<\/li>\n<li>RewriteCond\u00a0%{REQUEST_URI}\u00a0^system.*<\/li>\n<li>RewriteRule\u00a0^(.*)$\u00a0\/index.php\/$1\u00a0[L]<\/li>\n<li>RewriteCond\u00a0%{REQUEST_FILENAME}\u00a0!-f<\/li>\n<li>RewriteCond\u00a0%{REQUEST_FILENAME}\u00a0!-d<\/li>\n<li>RewriteRule\u00a0^(.*)$\u00a0index.php\/$1\u00a0[L]<\/li>\n<\/ol>\n<div><object width=\"0\" height=\"0\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"src\" value=\"http:\/\/oozman.com\/wp-content\/plugins\/google-syntax-highlighter\/Scripts\/clipboard.swf\" \/><param name=\"flashvars\" value=\"clipboard=RewriteEngine%20On%0ARewriteBase%20%2FYOUR-CI-ROOT-FOLDER%0ARewriteCond%20%25%7BREQUEST_URI%7D%20%5Esystem.*%0ARewriteRule%20%5E(.*)%24%20%2Findex.php%2F%241%20%5BL%5D%0ARewriteCond%20%25%7BREQUEST_FILENAME%7D%20!-f%0ARewriteCond%20%25%7BREQUEST_FILENAME%7D%20!-d%0ARewriteRule%20%5E(.*)%24%20index.php%2F%241%20%5BL%5D%0A\" \/><embed width=\"0\" height=\"0\" type=\"application\/x-shockwave-flash\" src=\"http:\/\/oozman.com\/wp-content\/plugins\/google-syntax-highlighter\/Scripts\/clipboard.swf\" flashvars=\"clipboard=RewriteEngine%20On%0ARewriteBase%20%2FYOUR-CI-ROOT-FOLDER%0ARewriteCond%20%25%7BREQUEST_URI%7D%20%5Esystem.*%0ARewriteRule%20%5E(.*)%24%20%2Findex.php%2F%241%20%5BL%5D%0ARewriteCond%20%25%7BREQUEST_FILENAME%7D%20!-f%0ARewriteCond%20%25%7BREQUEST_FILENAME%7D%20!-d%0ARewriteRule%20%5E(.*)%24%20index.php%2F%241%20%5BL%5D%0A\" \/><\/object><\/div>\n<\/div>\n<p><strong>Note:\u00a0<\/strong>You need to replace \u201cYOUR-CI-ROOT-FOLDER\u201d with your correct CI application folder.<br \/>\nEx: If you installed your CI application to,\u00a0<em>http:\/\/localhost\/APPS\/CIApp<\/em>. Then you need to replace \u201cYOUR-CI-ROOT-FOLDER\u201d by \u201c<em>APPS\/CIApp<\/em>\u201c.<\/p>\n<p><strong>Step 2:<\/strong><br \/>\nGo to you \u201capplication\/config\u201d folder and edit this line of code in your \u201cconfig.php\u201d.<\/p>\n<div>\n<ol start=\"1\">\n<li>\/\/from\u00a0$config[&#8216;index_page&#8217;]\u00a0=\u00a0&#8216;index.php&#8217;;<\/li>\n<li>\/\/to<\/li>\n<li>$config[&#8216;index_page&#8217;]\u00a0=\u00a0&#8221;;<\/li>\n<\/ol>\n<\/div>\n<p>Now, check you can access your CI URLs without adding \u201cindex.php\u201d. At this point, everything should work perfectly.<br \/>\nBut in case, it doesn\u2019t work, you can do this optional step below:<\/p>\n<p><strong>Optional Step:<\/strong><br \/>\nGo to you \u201capplication\/config\u201d folder and edit this line of code in your \u201cconfig.php\u201d.<\/p>\n<div>\n<div><\/div>\n<ol start=\"1\">\n<li>\/\/from\u00a0$config[&#8216;uri_protocol&#8217;]\u00a0\u00a0=\u00a0&#8216;AUTO&#8217;;<\/li>\n<li>\/\/to<\/li>\n<li>$config[&#8216;uri_protocol&#8217;]\u00a0=\u00a0&#8216;REQUEST_URI&#8217;;<\/li>\n<\/ol>\n<\/div>\n<p>So, there you have it. I hope this will help you as well. If you have any questions or suggestions, please feel free to comment below.<\/p>\n<p>Best Regards.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/oozman.com\/php-tutorials\/remove-index-php-codeigniter-windows\/ http:\/\/www.cikorea.net\/lecture\/view\/213\/page\/1 &nbsp; Hi guys, just want to share with you this simple solution on how to remove index.php in your CodeIgniter\u2019s URL if you\u2019re using a server based in&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts\/1076"}],"collection":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1076"}],"version-history":[{"count":0,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts\/1076\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}