trouble with my controllers (basic stuff) |
[eluser]nemanjanq[/eluser]
Hi, I have problem, with my controllers routing. I have setup this: config.php Code: $config['base_url'] = "http://localhost/project/"; routes.php Code: $route['default_controller'] = "home"; and now ... when I type in http://localhost/project/ - WORKING goes to my home controller http://localhost/project/home - NOT WORKING ? http://localhost/project/home/index - NOT WORKING ? http://localhost/project/admin/ - NOT WORKING ? (I have admin controller) if I add index.php in links like http://localhost/stampar_dev/index.php/home/index - WORKING. I tryed http://ellislab.com/codeigniter/user-gui.../urls.html to Removing the index.php file Code: RewriteEngine on when I do this all my links go back to http://localhost/ etc. my WAMP starting page. help.
[eluser]Dam1an[/eluser]
You're making the rewrite to an absolute path (just the / so it started from the web root) change it to be Code: RewriteEngine on It should then do the rewrite relative to the directory it's in (same as index.php)
[eluser]nemanjanq[/eluser]
Thanks! That little dot changed a lot. Now I have new problem. My css is not loading right. I have this in my views Code: <link type="text/css" rel="stylesheet" href="<?=base_url();?>assets/css/admin.css" /> and I get this out Code: <link type="text/css" rel="stylesheet" href="http://localhost/project/assets/css/admin.css" /> which looks fine assets is in my root folder, but when I click on Code: <link type="text/css" rel="stylesheet" href="http://localhost/project/assets/css/admin.css" /> I got 404 ?
[eluser]nemanjanq[/eluser]
damm, ... I just add assets, and it works. I need to learn more about .htaccess Code: RewriteEngine on |
Welcome Guest, Not a member yet? Register Sign In |