URL重写

apache

  1. httpd.conf 去掉;(开启重写模块)
  2. 在vhost.conf中配置虚拟主机,配置重写规则

nginx

1.nginx.conf 或者虚拟域名下

location / { // …..省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}

原文地址:https://www.cnblogs.com/jdhu/p/4601159.html