Reputation: 2660
I can't seem to get CodeIgniter set up properly on GoDaddy. I tried creating a new function inside of the 'wecome' controller. But I can't access it anywhere.
http://domain.com/test (No response) <- why doesn't this work
http://domain.com/index.php/welcome/test (No response) <- why doesn't this work
And just to give you an idea of how the default welcome page resolves:
http://domain.com/ (resolves to welcome page aka 'index' function)
http://domain.com/index.php/ (resolves to welcome page aka 'index' function)
http://domain.com/index.php/welcome (No response) <- why doesn't this work?
http://domain.com/index.php/welcome/index (No response) <-why doesn't this work?
How can I get this set up properly?
Upvotes: 0
Views: 5301
Reputation: 1945
To do this open your application/config/config.php file and change this:
$config['index_page'] = "index.php";
To this:
$config['index_page'] = "index.php?";
Upvotes: 0
Reputation: 1546
step 1. in your .htaccess file on root directory set this:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{HTTP_HOST} ^mydomain.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]
step 2. open /system/application/config/config.php file and make sure the following two options are set.
$config['index_page'] = “”;
$config['uri_protocol'] = “AUTO“;
hope this helped.
Upvotes: 5
Reputation: 901
Try putting this line:
@ini_set('cgi.fix_pathinfo', 0);
In your /index.php file. Also have a play with your URI_PROTOCOL setting in config.php.
Upvotes: 0
Reputation: 2183
Possible places where you can look for this problem would be, .htaccess file (never used godaddy,but i have seen others having different .htaccess rules for this hosting company), next is your application/config/config.php file and the uri_protocol, experiment with this one (there are few values you can pass), also depending on your CI version you can try extending the CI_URI or CI_Router classes in order to insert your logic somewhere along, but as I said this will greatly depends on the CI version you use, from 1.7 to 2.0.2 they made few changes to these classes responsible for routing and uri matching and if you cannot find solution, please come back and post more info.
Upvotes: 1