0

Everything works perfect in localhost, but when I host on server, it shows:

No input file specified

Please help me resolve this issue.

My .htaccess file looks like this:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
Andrew
  • 18,680
  • 13
  • 103
  • 118
Kathirmalan
  • 66
  • 1
  • 8
  • the code above is from localhost or web hosting server? Because putting the ? mark after index.php at last line solves this problem on web hosting server, without ? mark it works ok on localhost. – Vipin Kr. Singh Mar 04 '17 at 10:18
  • http://stackoverflow.com/questions/6118740/codeigniter-no-input-file-specified – Afaan Bilal Apr 16 '17 at 16:48

3 Answers3

1

I finally used this and it worked for me.

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]

If any suggestion are there to share, please post.

Kathirmalan
  • 66
  • 1
  • 8
0

you probably have a different server configuration not allowing .htaccess overrides. edit your apache httpd.conf so that AllowOverride be

AllowOverride All

You could try to execute with the http://server.com/index.php/controller/function api access to ensure that this is the case.

Nir O.
  • 1,563
  • 1
  • 17
  • 26
0

Try to replace this code into your .htaccess file

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

 <IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml

  # Remove browser bugs (only needed for really old browsers)
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  Header append Vary User-Agent
</IfModule>
Googlian
  • 6,077
  • 3
  • 38
  • 44