恼人的[否输入文件中选择" codeigniter(htaccess的) [英] Annoying "No input File Selected" Codeigniter (htaccess)

查看:191
本文介绍了恼人的[否输入文件中选择" codeigniter(htaccess的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过在这里对这个问题有类似的问题,但它并没有解决我的问题,我要再写。

我搬到一个客户的网站从我自己的测试服务器,以他们的previously买的网站托管lcn.com。虽然网页 http://mydomain.com 负荷精绝,任子页面(http://mydomain.com/页)给我的未选择输入文件的错误。

这必须是一个htaccess /服务器的架设问题,尽管LCN告诉我mod-rewrite是一切,并没有什么应该被限制。如果我访问的子页面平原方式, http://mydomain.com/index.php/page,它们加载的罚款。

所以,在这里去,这是我的htaccess文件。任何想法,为什么我有问题?

 < IfModule mod_rewrite.c>
RewriteEngine叙述上
的RewriteBase /

的RewriteCond%{REQUEST_URI} ^系统。*
重写规则^(。*)$ /index.php/$1 [L]
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
的RewriteCond $ l ^(指数\ .PHP |图片|机器人\ .TXT | CSS)!
重写规则^(。*)$的index.php / $ 1 [L]
< / IfModule>

<!IfModule mod_rewrite.c>

的ErrorDocument 404的index.php
< / IfModule>
 

解决方案

这是一千倍的问题在原有论坛(CI论坛)。虽然上述htaccess的一般工程,以从您的网址中删除的index.php,还有你需要检查一些额外的配置/试试。

  1. 您htaccess的。

     #重写规则^(。*)$的index.php / $ 1 [L]
    #虽然上面的规则似乎罚款在一般环境下,有时我需要修改成
    重写规则^ * $的index.php / $ 1 [L]
     

  2. 您的config.php

      // $配置['uri_protocol'] ='自动';
    //在某些环境下,你需要改变它
    // $配置['uri_protocol'] ='PATH_INFO';
    // 要么..
    $配置['uri_protocol'] ='REQUEST_URI';
     

Ive seen a similar question on here about this problem, but as it didn't resolve my issue, I have to write another.

I've moved a client's site from my own testing server to their previously bought site hosters lcn.com. While the homepage http://mydomain.com loads absolutely fine, any sub-page (http://mydomain.com/page) gives me the "No input file selected" error.

It must be an htaccess/server set up issue, although lcn have told me mod rewrite is all on, and nothing should be restricted. If I visit the subpages the plain way, http://mydomain.com/index.php/page, they load fine.

So, here goes, here's my htaccess file. Any thought as to why I have problems?

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>

ErrorDocument 404 /index.php
</IfModule>

解决方案

This is a thousand times question in the original forums(CI forums). And while above htaccess generally works to remove the index.php from your url, there are several additional config you need to check/try.

  1. Your htaccess.

    # RewriteRule ^(.*)$ index.php/$1 [L]
    # While above rule seems fine in general environment, sometime i need to modify that into
    RewriteRule ^.*$ index.php/$1 [L]
    

  2. Your config.php

    // $config['uri_protocol']  = 'AUTO';
    // In some environment, you need to change it
    // $config['uri_protocol']  = 'PATH_INFO';
    // or..
    $config['uri_protocol'] = 'REQUEST_URI';
    

这篇关于恼人的[否输入文件中选择&QUOT; codeigniter(htaccess的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆