我在我的项目中使用坦克。在我的本地人那里,一切都很好。但是,当我将项目上传到服务器时,我得到的错误是
未指定输入文件。
我知道这是因为htaccess。我的网址就像http://example.org/project/test/tankauth/。当我给出这个url时,它会用错误重定向到http://example.org/project/test/tankauth/index.php/auth/login。但是,如果我尝试使用像http://example.org/project/test/tankauth/index.php?/auth/login这样的url,它会工作得很好。
我的htaccess文件如下所示:
RewriteEngine on
RewriteBase /tankauth/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]我不擅长htaccess。
发布于 2014-03-14 07:09:43
我假设您在这一次使用apache,我还假设您没有对apache /etc/apache2/做任何更改,最后我假设您可以访问您的服务器,如果是这样的话,您可能需要检查http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride
在您的/etc/apache2 2/站点中-可用/默认在那里您会发现
<Directory /path/to/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None <---change None to FileInfo or All
Order allow, deny
allow from all
</Directory>然后重置apache -> service apache2 restart or sudo service apache2 restart
提示使用AllowOverride All的可能会指出一些严重的漏洞问题,如果这是一个生产服务器,我建议您不要使用它。
希望能帮上忙,干杯!
发布于 2017-04-06 15:50:55
试一试(更改最后一行)
RewriteRule ^(.*)$ index.php/$1 [QSA,L]以及在application/config/config.php中
$config['uri_protocol'] ="PATH_INFO";发布于 2017-05-21 08:09:10
这是工作。
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /tankauth/
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(.*)$ index.php/$1[L]
</IfModule>https://stackoverflow.com/questions/22397808
复制相似问题