thanhoangxuannghiep
thanhoangxuannghiep

Reputation: 67

Cannot run project by CodeIgniter

I have problem with my project. Because this is a secret, I can not publish my site here. I am sorry for this and this is my case.

I have a project based on the CodeIgniter framework, I run it successfully on localhost but when I use SVN to commit this project to my hosting. It do not run. I am trying to delete all file and commit only index.html with content is "test". Browser show result is "test". I am trying to commit this project again but result still is "test".

However, if I type index.php after my url "http://myaddress.com/index.php", I see my result which I would like. I have tried to config file "config.php" remove "index.php" in $config['index.php] = '' but nothing changes.

Upvotes: 0

Views: 1602

Answers (2)

Mohammed Safeer
Mohammed Safeer

Reputation: 21535

Add .htaccess file with the following rule in root folder,

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

To make .htaccess work , you have to enable apache module mod_rewrite

If you have access to server, you can type the following command in the terminal (for linux servers, this example specific to ubuntu)

a2enmod rewrite

Restart apache2 after

/etc/init.d/apache2 restart

or

service apache2 restart

If you have not access to server, please contact server administrator.

Upvotes: 0

joaobarbosa
joaobarbosa

Reputation: 630

From the CodeIgniter's doc, check the "Remove the index.php file" on this page: http://www.codeigniter.com/userguide2/general/urls.html

And just to remember, have you enabled Apache's mod_rewrite?

Upvotes: 2

Related Questions