如何在UBUNTU中从codeigniter中删除index.php

11 浏览
0 Comments

如何在UBUNTU中从codeigniter中删除index.php

我知道这个问题已经被问过了,我尝试了所有那些方法,但仍然无法从URL中移除index.php。

以下是我的具体情况:

Ubuntu 12.10
PHP:5.4.6
Mod_rewrite已开启
CI版本:2.1

.htacess文件如下:

RewriteEngine On

RewriteBase /projectname

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

我也查看了下面的链接,但没有成功...

Cannot remove index.php from url CI based site

How to remove "index.php" in codeigniter's path

我的"/etc/apache2/sites-available/default"文件如下:

ServerAdmin webmaster@localhost

DocumentRoot /var/www

Options FollowSymLinks

AllowOverride None

Options Indexes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

allow from all

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None

Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

Order allow,deny

Allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,

# alert, emerg.

LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

任何帮助都将不胜感激!

0