CI框架搭建
CI 框架等移植到不同等环境十分方便,只要改很少等配置:
1.修改config.php 文件(修改这一个文件就可以跑通了):
$config['base_url'] = 'http://127.0.0.1/bill/';
2.使apache支持 rewrite 模块(去掉index.php)
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 文件)
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /bill/index.php/$1 [L]
Stay hungry
Stay foolish