![]() |
CI + Leopard + htaccess - index.php = Impossible? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: CI + Leopard + htaccess - index.php = Impossible? (/showthread.php?tid=8479) |
CI + Leopard + htaccess - index.php = Impossible? - El Forum - 05-19-2008 [eluser]TheLoops[/eluser] Did anybody of you manage to get rid of the "index.php" in the URL using htaccess on Mac OS X 10.5 Leopard? Everything is working fine with my localhost testing server, except the htaccess rewriting. These are some excerpts from my setup: etc/apache2/httpd.conf: Code: #This is factory default: etc/apache2/users/username.conf: Code: <directory "/Users/username/Sites"> /Users/username/Sites/website/web_root/.htaccess: Code: <IfModule mod_rewrite.c> Whenever I remove the "index.php" from the URL I get 404: Code: 404 Page Not Found The site's web root is at: /Users/username/Sites/website/web_root/ The site's application is at: /Users/username/Sites/website/application/ The CI system is at: /Users/username/Sites/system/ What the heck am I doing wrong here? CI + Leopard + htaccess - index.php = Impossible? - El Forum - 05-19-2008 [eluser]James Gifford[/eluser] Have you tried using a simpler .htaccess file? Code: RewriteEngine On This is how I have mine setup and it works for me in Leopard. Although I don't have all the same settings in my http.conf file. CI + Leopard + htaccess - index.php = Impossible? - El Forum - 05-19-2008 [eluser]TheLoops[/eluser] Still no success ![]() CI + Leopard + htaccess - index.php = Impossible? - El Forum - 05-19-2008 [eluser]Chris Newton[/eluser] This is currently working for me, using 10.5. I'm also serving the pages with MAMP, but I'm guessing it'd work without it as well. Code: RewriteEngine On CI + Leopard + htaccess - index.php = Impossible? - El Forum - 05-19-2008 [eluser]TheLoops[/eluser] Still no success. But the mod_rewrite seems to be okay, as it shows a CI-generated 404 message. It's just that I can't access my controllers properly anymore. If I add the "index.php" again it works like a charme tough. Bummer… :down: CI + Leopard + htaccess - index.php = Impossible? - El Forum - 05-19-2008 [eluser]forlackofawittyname[/eluser] RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] The above works for me, I am not using MAMP or XAMMP but am using the default 10.5 install. A few caveats though: I don't have a virtual setup--I just use "localhost" as my hostname. CI + Leopard + htaccess - index.php = Impossible? - El Forum - 05-19-2008 [eluser]Chris Newton[/eluser] So, if the HTACCESS is working right... have you set the index file to "" in the config? CI + Leopard + htaccess - index.php = Impossible? - El Forum - 05-20-2008 [eluser]forlackofawittyname[/eluser] One other thing that might be worth mentioning--and I'm sorry that I did not do it earlier; I have set my default_controller to point to a controller that I have written. You do this in /application/config/routes.php. mahuti: I still have my index file set to"index.php": $config['base_url'] ="http://localhost/"; $config['index_page'] = "index.php"; $config['uri_protocol'] = "AUTO"; CI + Leopard + htaccess - index.php = Impossible? - El Forum - 05-20-2008 [eluser]GSV Sleeper Service[/eluser] I had no problems, but I'm not using the 'system' apache, I installed my own using macports. CI + Leopard + htaccess - index.php = Impossible? - El Forum - 05-20-2008 [eluser]TheLoops[/eluser] [quote author="mahuti" date="1211278055"]So, if the HTACCESS is working right... have you set the index file to "" in the config?[/quote]I had it still set to "index.php", but even after changing it to "" did not make it work. [quote author="forlackofawittyname" date="1211285258"]One other thing that might be worth mentioning--and I'm sorry that I did not do it earlier; I have set my default_controller to point to a controller that I have written. You do this in /application/config/routes.php. mahuti: I still have my index file set to"index.php": Code: $config['base_url'] ="http://localhost/"; [quote author="GSV Sleeper Service" date="1211293883"]I had no problems, but I'm not using the 'system' apache, I installed my own using macports.[/quote]I though, that maybe Apache isn't the bad guy, but something in my CI configuration. But even a fresh install of an un-altered application threw the 404. ![]() |