Welcome Guest, Not a member yet? Register   Sign In
index.php
#1

[eluser]patsm[/eluser]
Hi. I'm new to CI and am learning it with the help from the book Professional CodeIgniter. I am having a problem with the index.php. To access my site, I have to type in www.mydomain.com/CI-store/index.php. I would like to be able to access it by going to www.mydomain.com/CI-store.

I'm running this on an Apache web server, not xxamp or any other test environment.

Can someone help me with what I have done wrong? Thanks in advance.

I have set up .htaccess with code below and place it in the same place as index.php, license.txt, etc.

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|captcha|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

In the routes folder, I have have the default controller set as $route['default_controller']="welcome";

The controller looks like this

Code:
class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();    
    }
    
    function index(){
        $data['title'] = "Welcome to Our Store";
        $data['navlist'] = $this->MCats->getAllCategories();
        $this->load->vars($data);
        $this->load->view('template');
    }
#2

[eluser]trice22[/eluser]
Hello,

did you set the config item "index_page" in your config file? It should look like this:

Code:
$config['index_page'] = ""; // in line 26

I'm using online an .htaccess file that looks something like this:
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^(/index\.php|/images|/js|/css)
RewriteRule ^(.*)$ index.php?$1 [L]

Good luck,
trice
#3

[eluser]patsm[/eluser]
Yes, my config file was set to " " but my .htaccess file was a bit different. I copied yours and it works like expected now.

Thanks so much for your help!
#4

[eluser]trice22[/eluser]
Sure thing! Glad it helped.
—trice
#5

[eluser]patsm[/eluser]
Can I ask one more thing?

I'm writing my codeigniter code in Dreamweaver and it is a bit of a pain because it doesn't finish a lot of the coding, for example, it doesn't put a closing } after I start and if statement or it doesn't put in -> when typing $this->db->where('.... etc.

Is there a better application to write code igniter code in instead of dreamweaver or is there a way to make dreamweaver do it?
#6

[eluser]trice22[/eluser]
There are plenty of free and commercial IDEs and editors out there—the right one depends very much on your personal taste, style and other facts like OS.

I'm a mac user and like Textmate, Coda (very nice, but the editor itself is for designers rather than for developers IMO) and currently Aptana.
If you need something a bit bigger, have a look at Eclipse or again Aptana.

For Windows there's of course even more stuff available. I believe there has been a thread concerning this topic some time ago here on the forum:
Yep—found it: http://ellislab.com/forums/viewthread/71650/

—trice
#7

[eluser]tdktank59[/eluser]
I like Zend 5.5.1 never got into the new 6.0 version...
Of course this one costs some money but in my opinion its one of the better ones!

(i use 5.5.1 because the ftp servers are easier to use on it than 6.0...)




Theme © iAndrew 2016 - Forum software by © MyBB