![]() |
Removing index.php in Codeigniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Removing index.php in Codeigniter (/showthread.php?tid=57759) |
Removing index.php in Codeigniter - El Forum - 04-11-2013 [eluser]Edy S[/eluser] If your mod_rewrite curently enable, try this htaccess file and put on your codeigniter folder. Code: RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) write name of folder that allow to access via http for example : RewriteCond $1 !^(index\.php|images|js|robots\.txt) All name listed on that line will allow to access via http, i've use that code on my site : http://www.media-kreatif.com Removing index.php in Codeigniter - El Forum - 04-11-2013 [eluser]TheFuzzy0ne[/eluser] You may also want to try changing the value of $config['uri_protocol'] in ./application/config/config.php. Sometimes CodeIgniter gets it wrong. Changing it to PATH_INFO might work. Removing index.php in Codeigniter - El Forum - 04-13-2013 [eluser]faisal_memon[/eluser] @TheFuzzy0ne It worked !! Thanks a lot !! Removing index.php in Codeigniter - El Forum - 04-15-2013 [eluser]drewdin[/eluser] I am having the same issue that I have been struggling the last two days with. I want to remove index.php from my urls, when its there everything works fine. When i remove it, i get: Not Found The requested URL /CodeIgniter/home/index was not found on this server. Heres my setup: Mac OSX MAMP www/CodeIgniter/applications Heres my .htaccess in the root folder CodeIgniter Code: #Deny from all I have Code: $config['uri_protocol'] = 'AUTO'; I have my index path setup Code: $config['index_page'] = ''; Any suggestions are welcomed, i am pulling all of my hair out! thanks Removing index.php in Codeigniter - El Forum - 04-16-2013 [eluser]Unknown[/eluser] On most servers none of these will work, the correct method is: 1: index.php from the config so it is just: $config['index_page'] = ''; 2: Copy the following into your .htaccess file remember to put ? in front of index.php so it's: DirectoryIndex index.php RewriteEngine on RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA] Removing index.php in Codeigniter - El Forum - 04-16-2013 [eluser]TheFuzzy0ne[/eluser] Just out of interest, what happens when you go to www.yoursite.com/application? Do you still get the same error, or do you see the home page for your Web site? Please try changing: Code: RewriteRule ^(.*)$ index.php?/$1 [L] to: Code: RewriteRule ^(.*)$ /index.php?/$1 [L] And also ensure that mod_rewrite is enabled. Removing index.php in Codeigniter - El Forum - 04-16-2013 [eluser]drewdin[/eluser] I verified that mod_rewrite was enabled, if I browse to the path Code: http://localhost/CodeIgniter/ Code: http://localhost/CodeIgniter/about Quote:Not Found if I use Code: http://localhost/CodeIgniter/index.php/about Removing index.php in Codeigniter - El Forum - 04-16-2013 [eluser]TheFuzzy0ne[/eluser] You only answered one of my questions. ![]() What happens when you comment out the RewriteBase directive? Removing index.php in Codeigniter - El Forum - 04-16-2013 [eluser]drewdin[/eluser] Sorry about that, I modified my .htaccess file from Code: RewriteRule ^(.*)$ index.php?/$1 [L] Code: RewriteRule ^(.*)$ /index.php?/$1 [L] If i comment out the rewrite base, nothing changes. My home page works but that's it. I am still using the code below for my .htaccess. Code: <IfModule mod_rewrite.c> Is this not the recommended one to use? Thanks Removing index.php in Codeigniter - El Forum - 04-16-2013 [eluser]TheFuzzy0ne[/eluser] Did you try commenting out the RewriteBase directive? |