I know this has been asked a lot of times before, but I did search a lot without finding an answer. So I'm hoping someone will help me out. I have a shared hosting and inside the public_html folder I wish to install my CI app. The sub-directory name is "hrms".
So I uploaded all the CI files to hrms. Now when I visit http://www.example.com/hrms/index.php/login/do_login I get the famous error No input file specified.
I have tried with .htaccess file with several variations that I could find, but none have helped. The http://www.example.com/hrms/index.php is working, so I'm guessing all the config is all right.
What am I doing wrong? Also, is the .htaccess file a must, even if I intend to access the site via full URL?
==== .htaccess =====
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /hrms
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /hrms/index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /hrms/index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /hrms/index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
Much ado about nothing.
===== UPDATE =====
I've now discovered that the problem is with GoDaddy hosting (GoDaddy and CI have a hate-hate relationship, it seems). The trick is to define your index.php as index.php? (notice the question mark) in the config.php file.
Nevertheless, many thanks to everyone who put effort into it!
Please note: If you're fine with ugly URLs like http://www.example.com/index.php?/HomeController/myFunction and aren't using routing (like me for now), there is no need for the .htaccess file.