【发布时间】:2014-09-20 21:37:12
【问题描述】:
我使用 CodeIgniter 2.2.0 和 AppServ 2.5.10 作为本地服务器。 在 config.php 我确定来自: $config['index_page'] = ''; 这是根文件夹中的 .htaccess(护理):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /nursing/
#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]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
当我尝试访问:localhost/nursing/welcome/index 时,AppServ 欢迎页面出现了!,而不是应有的欢迎控制器!
【问题讨论】:
-
尝试把这个
.htaccess放到/nursing/.htaccess 并且把RewriteBase 改成/(而不是/nursing/)
标签: php .htaccess codeigniter