没有指定输入文件."在双应用程序编码器


"No input file specified." in Two-Application Codeigniter

我已经做了广泛的搜索,但找不到解决我的问题的方法。

我在两个应用程序中使用codeigniter -一个用于前端,一个用于后端。

我的目录树是这样的:

  • 应用程序
      后端
    • 前端
  • 系统
  • index . php
  • admin.php

我把htaccess文件写成:

RewriteEngine on
RewriteCond $1 !^(index'.php|images|table-images|js|robots'.txt|css)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

我想从URL中删除"index.php",但"admin.php"可以留下来,这没有问题。它在前端工作得很好,但是当我访问/admin.php/login时,它返回"没有指定输入文件"。

在Godaddy托管我没有这个问题,但现在我必须使用另一个托管公司。

你能帮帮我吗?谢谢大家

我找到了最适合我的方法,复制应用程序文件夹和index.php文件,并在名为backend的目录下创建一个新文件夹,您可能需要做一些调整。

应用程序文件夹index . php"后端"文件夹后端/应用"backend/index.php

$config['base_url'] = base_url;

我把主索引。php也复制粘贴到后端索引。php

/*
 *--------------------------------------------------------------------------
 * Base URL
 *--------------------------------------------------------------------------
 *
 * Attemtps to figure the root web address
 *
 */
if (isset($_SERVER['HTTP_HOST']))
{
$base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http';
$base_url .= '://'. $_SERVER['HTTP_HOST'];
$base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
}   
else
{
$base_url = 'http://localhost/';
}
define('BASE_URL', $base_url);
unset($base_url);

尝试这个htaccess并访问这个页面http://philsturgeon.co.uk/blog/2009/06/How-to-Multi-site-CodeIgniter-Set-up或http://philsturgeon.co.uk/blog/2009/07/Create-an-Admin-panel-with-CodeIgniter

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index'.php|images|robots'.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    #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 ^(.*)$ /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 ^(.*)$ /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 ^(.*)$ 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>