Hello there I am having some thoughts on my file structure in codeigniter.What I’m doing right now is creating a folder with the project I’m developing for and name it let’s say “myProject”
then I put my codeigiter folder inside that file.And then everything is done normally as by creating a class called myProject again on the controllers folder…
this structure works but it creates urls that are really ugly(for example in a local server):
http://localhost/myBlog/CodeIgniter_1.7.2/index.php/myBlog
also it creates some issues with my root folder…so if I have a css folder in my root I should call it like that:
“/myBlog/CodeIgniter_1.7.2/css/myBlogStyle.css”
and not like that:
“css/myBlogStyle.css”
do you have any suggestions on which is the right way to work with codeigniter?
thanks in advance
Just make your folder at the root level. Get rid of the CodeIgniter_1.7.2, you don’t need that folder.
For your css:
Then to access it, just
<link href="<?php echo base_url();?>css/default.css" rel="stylesheet" type="text/css" />To get rid of your “index.php” from your scripts, change/add a .htaccess file to the file like this. Just google a file of it and change the rewrite rule to: