什么是我的.htaccess设置?

时间:2017-07-14 12:13:00

标签: php .htaccess mod-rewrite httpd.conf

我目前正在使用CodeIgniter 3.它正在我的笔记本电脑上工作。 但是当我将它上传到我的Centos 6.9服务器时......我遇到了一个错误。 我已经检查了mod_rewrite是否已加载。

I want it to be like this URL/controller/method (no index.php after URL)

It shows me a 404 when i try to login which redirect me to this URL/gate/login

I also set this....
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

My htaccess on /var/www/html/calllist


<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /calllist/index.php?/$1 [L]
</IfModule>


My httpd.conf
DocumentRoot "/var/www/html"

<Directory />
  Options FollowSymLinks
  AllowOverride All
</Directory>

<VirtualHost *:80>
  ServerAdmin webmaster@xxxx.com
  DocumentRoot /var/www/html/calllist
  ServerName www.xxxx.com
  ErrorLog /var/www/html/calllist/error_log
  CustomLog /var/www/html/calllist/requests.log common
</VirtualHost>

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。 显然在httpd.conf上,还有另一条线需要设置为&#39; All&#39;。

我把它添加到我的虚拟主机

<Directory "/var/www/html/calllist">
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>