CI 框架等移植到不一樣等環境十分方便,只要改不多等配置:php
1.修改config.php 文件(修改這一個文件就能夠跑通了):web
$config['base_url'] = 'http://127.0.0.1/bill/';
2.使apache支持 rewrite 模塊(去掉index.php)apache
sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
修改配置 /etc/apache2/sites-available/default框架
ServerAdmin webmaster@localhost RewriteEngine On RewriteOptions Inherit 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>
3.添加 rewrite 規則 (網站根目錄的 .htaccess 文件)ide
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /bill/index.php/$1 [L]