请安装世界上最简单的东西XAMPP
找到文件夹xampp/htdocs
(所需的 Web 根文件夹)并在其中创建文件夹(项目名称),在其中解压缩/unrar/un7z CI,这样您的文件夹结构将是
xampp/htdocs/project_name/application
/system
/index.php
打开project_name/application/config
并浏览所有文件,逐一查看它们,这样您就知道 CI 可以做什么,不能做什么,每个文件中都很好地解释了每个设置的作用。
如果您是CI新手,请遵循此视频教程
如果您正在寻找好的.htaccess
文件,请抓住这个文件并根据需要进行更改
注意:这个文件应该在 /project_name
注意2:也config/config.php
设置index_page
为 $config['index_page'] = '';
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /<your project name>
#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]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
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>
更改后.htaccess
,config/config.php
您的网址“不错”
localhost/project_name/controller/method/parameter1/parameter2
最后:它是 CodeIgniter 而不是CodeIgnitor