Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess “烦人”;未选择输入文件";代码点火器(htaccess)_.htaccess_Codeigniter - Fatal编程技术网

.htaccess “烦人”;未选择输入文件";代码点火器(htaccess)

.htaccess “烦人”;未选择输入文件";代码点火器(htaccess),.htaccess,codeigniter,.htaccess,Codeigniter,我在这里看到了一个关于这个问题的类似问题,但由于它没有解决我的问题,我不得不写另一个 我已经将一个客户的站点从我自己的测试服务器移动到他们以前购买的站点hosters lcn.com。虽然主页的加载非常好,但任何子页面(http://mydomain.com/page)显示“未选择输入文件”错误 这一定是htaccess/服务器设置问题,尽管lcn告诉我mod rewrite已全部启用,不应限制任何内容。如果我以简单的方式访问子页面,它们的加载很好 这是我的htaccess文件。有没有想过我为什

我在这里看到了一个关于这个问题的类似问题,但由于它没有解决我的问题,我不得不写另一个

我已经将一个客户的站点从我自己的测试服务器移动到他们以前购买的站点hosters lcn.com。虽然主页的加载非常好,但任何子页面(http://mydomain.com/page)显示“未选择输入文件”错误

这一定是htaccess/服务器设置问题,尽管lcn告诉我mod rewrite已全部启用,不应限制任何内容。如果我以简单的方式访问子页面,它们的加载很好

这是我的htaccess文件。有没有想过我为什么会有问题

<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>

重新启动发动机
重写基/
重写COND%{REQUEST_URI}^系统*
重写规则^(.*)$/index.php/$1[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
1美元^(索引\.php | images | robots\.txt | css)
重写规则^(.*)$index.php/$1[L]
ErrorDocument 404/index.php

这是原始论坛(CI论坛)中的千次问题。虽然上面的htaccess通常可以从url中删除index.php,但您还需要检查/尝试其他一些配置

  • 您的HTC访问权限

    # 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]
    
  • 您的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';
    

  • 我会看看RewriteBase,可能是它应该是类似于
    /webhost/globalroot/mydomain/
    的东西,我以前从未在RewriteBase中包含文档路径-在所有主机上,我遇到过一个简单的/或子目录。不管怎么说,我只是试了一下,结果是500秒。嗨,toopay-谢谢你的回复。事实上,我已经尝试了在CI论坛上找到的所有东西,但对htaccess或uri协议设置的任何更改都没有帮助。你在这里的两个建议并不能解决这个问题。你还有其他想法吗?在一些(奇怪的)情况下/环境中,我需要在重写规则
    RewriteRule^(.*)$index.php?/$1[L]
    中添加“?”,我尝试了一下(这当然是一个奇怪的环境),奇怪的是,所有页面都重定向到主页-奇怪吗?尝试将您的uri协议更改为
    请求uri
    ,在上面给出的各种htaccess中尝试一下……你太棒了。REQUEST_URI+index.php?/$i(带问号)有效。最后那真是浪费时间!再次感谢。