![]() |
Rewrite/htaccess issues (I think) - 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: Rewrite/htaccess issues (I think) (/showthread.php?tid=6785) |
Rewrite/htaccess issues (I think) - El Forum - 03-11-2008 [eluser]Crazy88s[/eluser] *Edit* I think I posted this to the wrong forum. Will move. Please delete. -------------------------------------------------------------------------------------- Hello! Very new to codeigniter and am looking for some help in setting up my system correctly. Here's my setup: - Windows Vista - XAMPP My document root is C:\xampp\htdocs Within the document root I have a folder called codeignite which holds all the codeigniter files. When I run http://localhost/codeignite/ I get the "it's working" page. So far so good. I made a copy of the welcome controller and named it journal and like wise with the view I made a journal_message view. When I go to http://localhost/codeignite/journal I get redirect back to http://localhost/xampp/. I enabled mod_rewrite in the httpd.conf file and added a .htaccess file to the C:\xampp\htdocs\codeignite\system\application directory. The contents are: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> <IfModule !mod_rewrite.c> # If we don't have mod_rewrite installed, all 404's # can be sent to index.php, and everything works as normal. # Submitted by: ElliotHaughin ErrorDocument 404 /index.php </IfModule> I also removed index.php from the codeigniter config.php file. I do have a index method in the journal controller so why can't I go to http://localhost/codeignite/journal and see the correct page? If I'm missing anything then please let me know. Thank you! Rewrite/htaccess issues (I think) - El Forum - 05-26-2008 [eluser]Unknown[/eluser] I had the same problem, the following link helped me: http://codeigniter.com/wiki/mod_rewrite/ I did some things in a slightly different manner than they instructed, but it still worked. So here's a brief summary of what worked for me: - I didn't use command prompt, I just created my .htaccess file in my normal IDE. - In the third line of the .htaccess code (from the link above), I changed "RewriteBase /" to "RewriteBase /CodeIgniter/" (will be RewriteBase /codeignite/ in your case) - Just like they say, open system/application/config/config.php and change $config['index_page'] = "index.php"; to $config['index_page'] = ''; - For windows, open C:\xampp\apache\conf\httpd.conf and uncomment the following line: LoadModule rewrite_module modules/mod_rewrite.so - Still inside httpd.conf, find a line like the following: <Directory "C:/xampp/htdocs"> Inside that section, add the following: Options Indexes Includes FollowSymLinks MultiViews AllowOverride AuthConfig FileInfo Order allow,deny Allow from all (the last two lines of the four are probably already in there) - Remember to restart apache server That's it. Rewrite/htaccess issues (I think) - El Forum - 05-26-2008 [eluser]Sean Murphy[/eluser] Your RewriteBase is wrong. It should be RewriteBase /codeignite/. I'd try changing that before anything else. |