![]() |
Codeigniter, xampp (windows), mod_rewrite issues. - 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: Codeigniter, xampp (windows), mod_rewrite issues. (/showthread.php?tid=25197) |
Codeigniter, xampp (windows), mod_rewrite issues. - El Forum - 12-03-2009 [eluser]LonestarGEEK[/eluser] I'm a noob to CodeIgniter and am trying to figure out the configuration for an app I'm building. Something is wrong with my setup. I'm running XAMPP on Windows and am using an alias directory to point to the applications directory. In other words: "http://localhost/app_name/ " points to the root directory of the application. It all seems to work well until I do the .htaccess for mod_rewrite. Then every time I try to go to a controller I get pitched back to the xampp root. My config is: Directories Code: /app_root .htaccess Code: <IfModule mod_rewrite.so> index.php Code: $system_folder = "@codeigniter"; app_name/main/config/config.php Code: $config['base_url'] = "http://localhost/app_name/"; app_name/main/config/routes.php Code: $route['default_controller'] = "home"; I should also state that the app_name directory is an alias for a different drive than the apache root. Code: Apache Root: c:\xampp\htdocs\ The alias is: Code: Alias /app_name "d:/projects/app name/development" Thanks in advance for the help... Codeigniter, xampp (windows), mod_rewrite issues. - El Forum - 12-03-2009 [eluser]Daniel Moore[/eluser] Try making the following change and see if that works for you. Code: <IfModule mod_rewrite.c> I noticed you used <IfModule mod_rewrite.so>, but then you used <IfModule !mod_rewrite.c>. You should either be using mod_rewrite.so OR mod_rewrite.c, but they are not interchangeable. If you're using XAMPP on Windows, then it's most likely using mod_rewrite.so. You can determine this from the XAMPP\apache\conf\httpd.conf file. Do a search in a text editor for mod_rewrite.so and for mod_rewrite.c. The one you find is the one you should use. Also, try reading up on my tutorial. It should help you create a working .htaccess file for CodeIgniter for almost any server configuration, so it will be helpful when you start uploading your project to the web. Tutorial: Removing index.php from CodeIgniter with .htaccess Codeigniter, xampp (windows), mod_rewrite issues. - El Forum - 12-03-2009 [eluser]LonestarGEEK[/eluser] [quote author="Daniel Moore" date="1259917947"]Try making the following change and see if that works for you. ... I noticed you used <IfModule mod_rewrite.so>, but then you used <IfModule !mod_rewrite.c>. ... Also, try reading up on my tutorial. It should help you create a working .htaccess file for CodeIgniter for almost any server configuration, so it will be helpful when you start uploading your project to the web. [/quote] Daniel, I read your tutorial once, but I will try it again. "mod_rewrite.so" is the correct one on my xampp install. My development environment is local, but I have a staging environment that is for the customer to view. So I comment out one or the other. I had accidentally missed that. I've set the default controller to "home" and the website comes up correctly, but now I can't get to: Code: http://localhost/winscore/welcome/ Which should be correct. The URL is redirected to "http://localhost/winscore/welcome/" but the code that comes up is the default controller "home.php". I'll reread your tutorial again and let you know if I've figured it out. Thanks for the help! Codeigniter, xampp (windows), mod_rewrite issues. - El Forum - 04-27-2010 [eluser]morcegon[/eluser] Thanks man, it's work!! Codeigniter, xampp (windows), mod_rewrite issues. - El Forum - 11-22-2010 [eluser]nhantam[/eluser] “mod_rewrite.so” Thanks you very much |