按理说,配置完以下四步可完成
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
当我用URL访问的时候
http://127.0.0.1/xn/Admin/Public/login
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
127.0.0.1
Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.1
求大神帮看看我还少了什么,
AD:真正免费,域名 虚机 企业邮箱=0元