【问题标题】:CodeIgniter in subdomain folder, removing the index.php from address子域文件夹中的 CodeIgniter,从地址中删除 index.php
【发布时间】:2011-06-22 22:57:55
【问题描述】:
【问题讨论】:
标签:
.htaccess
codeigniter
【解决方案1】:
我认为您缺少一个“?”。 RewriteRule ^(.*)$ /index.php?/$1 [L]
这是 CI 推荐的 .htaccess 模板(或者至少是一年前的),? 是两者之间的主要区别。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>