system and application folders above the web root |
Hi
To make a long story short. My folders structure is as follows : Quote:projectMy .htaccess : Code: RewriteEngine On Quote:localhost/projectrouters method _set_request() receives as argument an array : Quote:segments ( [0] => project )and makes directly "project" controller's name. What am I missing ? Is it a configuration issue or something else ? Thx in advance for any response.
Finally within _parse_request_uri() of CI_URI class, I modified :
PHP Code: if (isset($_SERVER['SCRIPT_NAME'][0])) PHP Code: $script_name = (string) str_replace($this->config->item('public_folder_name'), '', $_SERVER['SCRIPT_NAME']);
Anyone with significant CI experience have a better solution than the one presented above? I'm asking because I am having the exact same problem as OP, and I've looked all over the Internet for a solution to no avail.
I've tried many different combinations and configurations of .htaccess, Apache vhosts, and mod_rewrite, but nothing works. CI keeps thinking that the subdirectory that my code resides in is part of the default controller name. I'd like to not have to modify CI core files in order to get this to work, but I will if I struggle with this for too much longer. Thanks all
You don't have to modify core classes, and really shouldn't. You extend them and can override methods or add new ones.
http://www.codeigniter.com/user_guide/ge...core-class
Try adding a RewriteBase /project to your htaccess file.
I create my app as below:
1. Folder structure: ----------------------------- Code: application All the files in the public folder are available to all users through http. Note: the index.php was moved to public folder. 2. Modify the index.php: ----------------------------- PHP Code: $system_path = '../system'; 3. Content of .htaccess: ----------------------------- Code: Options +FollowSymLinks And that works for me. |
Welcome Guest, Not a member yet? Register Sign In |