config route help |
[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?
[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]
[eluser]dadamssg[/eluser]
didn't work. if i type in mysite.com/blog it goes to my index.php frontpage of my website...
[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'] = "";
[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/";
[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>
|
Welcome Guest, Not a member yet? Register Sign In |