更新时间:2023-02-09 08:06:37
codeigniter的安装非常简单
The installation of codeigniter is very simple
从文档 https://codeigniter.com/user_guide/installation/index.html
在您的application/config/config.php中进行如下设置
in your application/config/config.php make setting like this
$config['base_url'] = 'http://'. $_SERVER['HTTP_HOST'] .'/your_project/';
完成后,访问您的网站
http://localhost/your_project/index.php
仅此而已
如果您想访问自己的控制器
If you want to access your own controller
http://example.com/[controller-class]/[controller-method]/[arguments]
示例:
要删除index.php,请编辑.htaccess
to remove index.php, edit your .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /your_project/
#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]
</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>