目标格式 /user/login.html
- apache
RewriteEngine on
# Apache 2.4
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*?)([^/]*).html(.*)$ index.php?$1-$2.html$3 [L]
- iis
- nginx
location / {
if (!-e $request_filename) {
rewrite ^((.*)/) /index.php last;
}
}
参考:http://www.wellcms.cn/read-6.html
来源:oschina
链接:https://my.oschina.net/u/2351685/blog/4291839