按理说,配置完以下四步可完成
1、httpd.conf配置文件中加载了mod_rewrite.so模块
2、AllowOverride None 将None改为 All
3、确保URL_MODEL设置为2
4、把下面的内容保存为.htaccess文件放到入口文件的同级目录下
这是我的 httpd.conf 配置
#LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule sed_module modules/mod_sed.so
AllowOverride All
Require all denied
这是 httpd-xampp.conf 配置
Alias /xn "E:/WEB/xn/"
Options Indexes FollowSymLinks Includes ExecCGI
#Options None
AllowOverride All
Require all granted
项目入口
以下是.htaccess文件内容
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
我的config.php