Skip to content

Instantly share code, notes, and snippets.

@shangdev
Created June 16, 2017 11:11
Show Gist options
  • Save shangdev/95c8892f74b85758297c0bc69753ba7b to your computer and use it in GitHub Desktop.
Save shangdev/95c8892f74b85758297c0bc69753ba7b to your computer and use it in GitHub Desktop.
思途cms5.0 Nginx 伪静态规则.
location /phone/ {
if (!-e $request_filename){
rewrite ^/(.*)$ /phone/index.php last;
}
}
location /newtravel/ {
if (!-e $request_filename){
rewrite ^/(.*)$ /newtravel/index.php last;
}
}
location /min/ {
rewrite ^/(.*)$ /min/index.php last;
}
location /payment/ {
if (!-e $request_filename){
rewrite ^/(.*)$ /payment/index.php last;
}
}
rewrite ^/(uploads/.*?_\d+x\d+\.(jpg|gif|png|jpeg))$ /image/index.php?$1 last;
if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if ($uri !~ "^/(uploads|public|newtravel|phone|payment|min)(/)?"){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite /.* /index.php last;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment