[ Apache ]
1、打开httpd.conf配置文件,搜索mod_rewrite.so,把所在行前面的#去掉。
2、搜索AllowOverride,将None改为 All。
3、把下面的内容保存为.htaccess文件放到应用入口文件的同级目录下Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond $1 !^(DATA|images|otherThings)
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
[ Nginx ]
在Nginx低版本中,是不支持PATHINFO的,但是可以通过在Nginx.conf中配置转发规则实现:location / { // …..省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}