从ubantu14.04中的codeigniter-3中的url中删除index.php

时间:2016-03-10 11:49:52

标签: php codeigniter-3

我有Ubantu 14.04机器,我也检查了Link

我的phpinfo()说rewrite_module是启用我也对config.php进行了更改

  

$ config ['index_page'] ='';

以下是我在根目录上的.htaccess文件

RewriteEngine On
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

2 个答案:

答案 0 :(得分:0)

试试这个

Options +FollowSymLinks
IndexIgnore */*
# Turn on the RewriteEngine
RewriteEngine On
#  Rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

答案 1 :(得分:0)

我刚刚添加了解决方案

<Directory /var/www/html >
   Order allow,deny
   AllowOverride All
   Allow from all
   Require all granted 
 </Directory> 

进入文件/etc/apache2/sites-available/000-default.conf并且工作正常