我知道這已被問了很多次,但我沒有找到答案,搜索了很多。所以我希望有人能幫助我。我有一個共享主機,並在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