我的项目在本地系统 (XAMPP) 上运行良好,但是当上传到托管服务器时它无法运行。我正在使用 Codeigniter 框架。可通过“localhost/myproject/controller”在本地主机中访问,但在主机服务器中无法通过 myproject.com/controller 甚至 myproject.com/index.php/controller 访问!
在服务器上,主域是(假设 D.COM,附加域是 AD.COM)。我的应用程序安装在插件域下。因此我的文件夹结构是
public html/
AD.COM/
application/
Config
Controllers
Modules
Views
System/
User_guide/
.htaccess
.htaccess 包含这段代码
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]
还维护了这些变量
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
如何解决这个问题。我尝试使用谷歌搜索但没有得到任何帮助。提前致谢。
最佳答案
请注意 Codeigniter 命名转换 并记住 Linux 主机区分大小写。
您没有提供与您的问题相关的任何资源。因此必须说明的是检查url 和 Controller 名称 的Spellings 以及您将进一步调用的方法。
关于php - 无法访问 Live Server 中的 codeigniter Controller ,但可以在本地主机中访问(Windows 上的 xampp),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32714538/