我知道这已被问了很多次,但我没有找到答案,搜索了很多。所以我希望有人能帮助我。我有一个共享主机,并在public_html文件夹中,我希望安装我的CI应用程序。子目录名称是“hrms”。Codeigniter 2共享托管子目录安装
所以我上传了所有CI文件到hrms。现在,当我访问http://www.example.com/hrms/index.php/login/do_login时,出现着名的错误No input file specified.
我尝试使用.htaccess文件,其中有几个可以找到的变体,但都没有帮助。 http://www.example.com/hrms/index.php正在工作,所以我猜所有的配置都没问题。
我在做什么错?另外,即使我打算通过完整的URL访问网站,.htaccess文件也是必须的。
====的.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>
您是否在index.php之前在htaccess中包含了您的目录名... – CMPS 2014-10-29 13:22:14
我猜不是。你能指点我一个很好的示例.htaccess将在我的情况下工作? – dotslash 2014-10-29 13:23:46
你可以把你的hataccess代码,所以我修改它 – CMPS 2014-10-29 13:25:05