【发布时间】:2014-03-20 01:39:00
【问题描述】:
我不知道是因为我编写的 $routes[] 配置还是任何原因,只是将 CI 放入服务器带来的欢迎消息很好。这甚至不适用于 .htaccess 我导致删除 htaccess 也会导致任何请求的 404。 我在 app 文件夹和系统文件夹中有这个 .htaccess
RewriteEngine On
RewriteBase /
RewriteCond $1 ^(application|system|private|logs)
RewriteRule ^(.*)$ index.php/access_denied/$1 [L]
RewriteCond $1 ^(index\.php|robots\.txt|favicon\.ico|public|assets|resources|css|js|images)
RewriteRule ^(.*)$ - [L]
RewriteRule ^(.*)$ index.php/$1 [L]
并且根目录中的这个 .htaccess 重定向到维护索引并允许到当前的开发文件夹:
RewriteEngine On
RewriteCond %{REQUEST_URI} !(index.php|x-folder|ci2) [NC]
RewriteRule ^ /index.php [L]
我的 route.php 看起来像这样:
$route['default_controller'] = 'site/home';
$route['404_override'] = '';
/********** *********************Admin routes****************/
$route['admin']='admin/user/login/' ;
$route['admin/home']='admin/home' ;
$route['admin/gallery']='admin/home/gallery' ;
$route['admin/calendar']='admin/home/calendar' ;
并且在配置中我已将重要配置更改为:
$config['base_url']= 'http://example.com.bd/';
$config['index_page'] = '';
仅供参考:我在本地主机中的应用程序运行良好。 我在 EC2(Amazon) 上,当前的 php 版本是 5.2.3——codeigniter 很好地支持,mysql>5.5
我真的被困住了,谁能帮我离开这个地狱!?
【问题讨论】:
-
你为什么将 default_controller 设置为一些干净的 url (site/home/)?它应该指向 home 是 home.php 的站点/主页
-
确实,是的。已编辑!
-
你能在这里看到什么吗?我该如何解决这个问题?
-
成功了吗?你还在用 404 吗?
-
@MohammedAshiq 不..不,我的意思是我从一开始就拥有它的站点/主页,我只是在问题上打错了..此外,CI 避免了斜杠。无论如何,我的路线中都没有。你有什么建议吗?
标签: php mysql .htaccess codeigniter amazon-ec2