我知道这个问题已经被问过了,我尝试了所有这些但仍然无法从 url 中删除 index.php。这是我的详细信息
Ubuntu 12.10
PHP : 5.4.6
Mod_rewrite in on
CI verson: 2.1
.htacess 看起来像:
RewriteEngine On
RewriteBase /projectname
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
我还查看了以下链接,但没有运气.. 无法从基于 url CI 的站点中删除 index.php
如何删除codeigniter路径中的“index.php”
我的“/etc/apache2/sites-available/default”是这样的:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
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
</VirtualHost>
任何帮助表示赞赏!