我在Windows 7操作系统上安装了Apache 2.2,Php 5.4.5和Mysql 5.5.27.我的localhost位置是G:/ local_server.我已下载CodeIgniter_2.1.3并解压缩到local_server并重命名CodeIgniter.我在CodeIgniter文件夹上创建.htaccess文件并通过以下代码:
<IfModule mod_rewrite.c>
# Turn on URL rewriting
RewriteEngine On
# If your website begins from a folder e.g localhost/my_project then
# you have to change it to: RewriteBase /my_project/
# If your site begins from the root e.g. example.local/ then
# let it as it is
RewriteBase / CodeIgniter/
# Protect application and system files from being viewed when the index.php is missing
RewriteCond $1 ^(application|system|private|logs)
# Rewrite to index.php/access_denied/URL
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L] …Run Code Online (Sandbox Code Playgroud)