【发布时间】:2010-12-06 10:10:20
【问题描述】:
我正在我的本地主机(Usbwebserver 应用程序)上开发一个站点。我正在使用 CodeIgniter 框架:
网址是“http://localhost/daniel/index.php”
有以下选项:
配置/路由:
$route['default_controller'] = "site";
配置/配置:
$config['base_url'] = "http://localhost/daniel";
$config['index_page'] = "";
$config['uri_protocol'] = "REQUEST_URI";
我尝试了以下 .htaccess 代码:
重写引擎开启 重写基础/
#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]
# 如果我们没有安装 mod_rewrite,所有 404 的 # 可以发送到 index.php,一切正常。 # 提交人:ElliotHaughin
ErrorDocument 404 /index.php
我想删除 index.php 并使用 http://localhost/daniel 加载我的默认控制器。
有什么建议吗?
【问题讨论】:
标签: .htaccess mod-rewrite codeigniter