【问题标题】:Code igniter url rewrite on EC2EC2 上的 Codeigniter url 重写
【发布时间】:2013-11-19 18:59:18
【问题描述】:

我有一组 Codeigniter 网站托管在
http://ec2-23-22-24-128.compute-1.amazonaws.com/

但是,当我尝试通过子域访问时失败:

http://ec2-23-22-24-128.compute-1.amazonaws.com/dashboard

http://ec2-23-22-24-128.compute-1.amazonaws.com/index.php/dashboard

我已经设置了htaccess并设置了AllowOverride All

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]

谁能给点建议?

【问题讨论】:

  • 看起来你是从 wordpress 中抄袭的?只需保持简单并直接从 ci 的指南中复制
  • 它在 Localhost WAMP 上运行良好。现在它在所有其他页面上显示为空白

标签: linux apache codeigniter amazon-web-services amazon-ec2


【解决方案1】:

如果您访问 Codeigniter 指南:
http://ellislab.com/codeigniter%20/user-guide/general/urls.html

它清楚地表明你可以将它用于mod_rewrite

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

【讨论】:

  • not working still 根本不是描述性的。以上是 CI 推荐的重写,它适用于我和其他许多人。您需要调试您的条目,确保在您的服务器上启用mod_rewrite
猜你喜欢
  • 2012-08-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-02-15
  • 1970-01-01
相关资源
最近更新 更多