0

I'm trying to create a RESTful api using CodeIgniter.

Everything is working fine locally, but I'm getting "No input file specified." message when deployed on production.

https://mydomain/api/controller/function

Based on numerous research, .htaccess might be causing this.

here is the .htaccess of api

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]  

in config.php

$config['base_url'] = '';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'AUTO';

I have tried replacing with RewriteRule ^(.*)$ index.php?/$1 [L] based here, still doesn't work.

Community
  • 1
  • 1
Hard Spocker
  • 765
  • 11
  • 32
  • When you use the target `index.php?`, you must also adjust `index_page` and `uri_protocol`, see https://github.com/bcit-ci/CodeIgniter/wiki/Godaddy-Installation-Tips – Olaf Dietsche Feb 17 '17 at 20:02
  • i adjusted it. still not working – Hard Spocker Feb 17 '17 at 21:39
  • Ok does you htaccess file even work on production? You have moved this to a new server. Are you sure .htaccess use is enabled? Put some garbage text in the top of the file and see if you get an error loading the site. – Panama Jack Feb 17 '17 at 21:49
  • yeah when i try putting garbage on htaccess, im getting "internal server error" instead of "No input file specified" so i guess my htaccess is being read – Hard Spocker Feb 17 '17 at 22:18
  • When I search through CodeIgniter sources, there is no message "No input file specified". So maybe this has nothing to do with htaccess or CodeIgniter, but your web application or at least in combination with your app. – Olaf Dietsche Feb 18 '17 at 12:14
  • but how is it running on my local server? – Hard Spocker Feb 20 '17 at 02:22

0 Answers0