【问题标题】:Redhat: .htaccess not workingRedhat:.htaccess 不工作
【发布时间】:2017-06-08 00:23:39
【问题描述】:

在codeignitor .htaccess 不能在redhat 服务器上运行相同的.htaccess 在本地服务器上运行良好,即xampp 还将 'AllowOverride None' 更改为 'AllowOverride All' 。请仅针对“redhat”给出答案。

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
</IfModule>

phpinfo() 显示 Apache Configuration

【问题讨论】:

  • 红帽?是您的操作系统,而不是您的网络服务器!所以 htaccess 处理的是 apache 而不是 redhat
  • 哎呀!但请给我答案。
  • 检查是否启用了 mod_rewrite ...等
  • 如何查看

标签: php .htaccess codeigniter redhat


【解决方案1】:

重写模块似乎是从您的屏幕截图中加载的。 您还可以通过添加此节从您的 VirtualHost 中启用 .htaccess:

  #Enable readin .htaccess
  <Directory "/var/www/html/mysite">
    AllowOverride All
  </Directory>

【讨论】:

    猜你喜欢
    • 2011-04-05
    • 1970-01-01
    • 2017-06-12
    • 2012-04-30
    • 2012-11-02
    • 2010-10-31
    • 2015-11-16
    • 2016-03-01
    相关资源
    最近更新 更多