config route help - 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: config route help (/showthread.php?tid=26234) |
config route help - El Forum - 01-09-2010 [eluser]dadamssg[/eluser] so i want my urls to be clean and i thought they were. i put something in my .htaccess file at my root so i could go to mysite.com/blog instead of mysite.com/CodeIgniter/index.php/blog and then i set my config file like so Code: $config['base_url'] = "http://mysite.com/CodeIgniter/"; but now when i submit a form on one of my controllers it goes to http://mysite.com/CodeIgniter/index.php/mains which pulls up and displays the right page but how the heck do i get the"/CodeIgniter/index.php" out of there for good? config route help - El Forum - 01-09-2010 [eluser]T I[/eluser] but how the heck do i get the”/CodeIgniter/index.php” out of there for good? simple: change: $config['base_url'] = "http://mysite.com/CodeIgniter/"; to $config['base_url'] = "http://mysite.com/"; and $config['index_page'] = ""; you can write your htaccess like this: RewriteEngine on RewriteCond $1 !^(index\.php|images|css|js|stylesheets|javascript|robots\.txt|favicon\.ico) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] config route help - El Forum - 01-09-2010 [eluser]dadamssg[/eluser] didn't work. if i type in mysite.com/blog it goes to my index.php frontpage of my website... config route help - El Forum - 01-09-2010 [eluser]WebsiteDuck[/eluser] Use the .htaccess you were using before Then in /application/config/config.php Change your index_page like so: Code: $config['index_page'] = ""; config route help - El Forum - 01-10-2010 [eluser]dadamssg[/eluser] i did that and instead of having urls like this mysite.com/CodeIgniter/index.php/main/sports it was like this with a 404 mysite.com/CodeIgniter/main/sports i have this mod_rewrite in my .htaccess file Quote:<IfModule mod_rewrite.c> and my base url in my config file is $config['base_url'] = "http://mysite.com/CodeIgniter/"; config route help - El Forum - 01-10-2010 [eluser]Cro_Crx[/eluser] This line: Code: RewriteBase / Should be the folder where your CI application is in. At the moment it's saying it's in the root directory. From your URI That doesn't seem to be the case. If your project is within the 'CodeIgniter' folder then change it to Code: RewriteBase /CodeIgniter The two lines you've altered to have the CodeIgniter path should be changed back to what they were originally. Here's a full working config: Code: <IfModule mod_rewrite.c> config route help - El Forum - 01-10-2010 [eluser]dadamssg[/eluser] you're a genius. THANK YOU Cro_Crx |