subdir and 404 |
[eluser]vishok[/eluser]
I'm a newbie of codeigniter. I have a problem with my webapplication made with codeigniter. I mean : my local webserver is on http://localhost:8888/ and my apache root dir is /htdocs i have two projects (called enrico and roberto) under this webserver like : htdocs enrico application controllers cantiere cliente system assets roberto application system assets when i write in my browser http://localhost:8888/enrico/cantiere, the browser give me 404 error if i set my apache root dir on /htdocs/enrico when i write in my browser http://localhost:8888/cantiere everything works well. This is my htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L] </IfModule> <IfModule !mod_rewrite.c> ErrorDocument 404 /index.php </IfModule> This is my config.php : $config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http"); $config['base_url'] .= "://".$_SERVER['HTTP_HOST']; $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); $config['index_page'] = ""; what is the matter? Thanks
[eluser]mi6crazyheart[/eluser]
Try this & tell me : http://localhost:8888/enrico/index.php/cantiere
[eluser]vishok[/eluser]
Thanks. In this way it works correctly but i don't like to have index.php in the url. Do you know how i can solve?
[eluser]pickupman[/eluser]
Index.php does all of the work, so when you remove you force apache to secretly run index.php for all url requests, and the url gets processed by CI. In order to have two separate applications running in the same folder/subfolder, you will need to keep index.php and index2.php(or another name). It's a small trade off, but I run it this way at work to aggregate data from different databases into one simple dashboard. Menu links with the appropriate index.php file take me into that app. |
Welcome Guest, Not a member yet? Register Sign In |