2014-10-29 38 views
0

我知道这已被问了很多次,但我没有找到答案,搜索了很多。所以我希望有人能帮助我。我有一个共享主机,并在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> 
+0

您是否在index.php之前在htaccess中包含了您的目录名... – CMPS 2014-10-29 13:22:14

+0

我猜不是。你能指点我一个很好的示例.htaccess将在我的情况下工作? – dotslash 2014-10-29 13:23:46

+0

你可以把你的hataccess代码,所以我修改它 – CMPS 2014-10-29 13:25:05

回答

0

无事生非。

===== UPDATE =====

我现在发现,这个问题是与GoDaddy托管(GoDaddy的和CI有恨,恨的关系,看起来是)。诀窍是将你的index.php定义为index.php? (注意问号)在config.php文件中。

尽管如此,非常感谢所有努力的人!

请注意:如果你的罚款与丑陋的网址,像http://www.example.com/index.php?/HomeController/myFunction并没有使用路由(像我现在),是没有必要的.htaccess文件。

+0

没问题:)很高兴我们可以/试图帮助。 – PaulSkinner 2014-10-30 16:39:26

+0

真的,我为所有的努力而感到谦卑。希望将来我会继续得到这样的支持。 :) – dotslash 2014-10-30 16:45:08

+0

没问题。如果它是基于CodeIgniter的,我会永远给它看看,如果你标记我:)(没有承诺速度虽然...) – PaulSkinner 2014-11-05 11:29:12