# nginx configuration by https://winginx.com/en/htaccess  https://www.bt.cn/Tools/apache_to_nginx
#阿里云空间用nginx时，可以用下面代码。

index index.php;

error_page 404 /404.html;

location /404 {
  rewrite ^/404.html /index.php?file=404;
}

location /index {
  rewrite ^/index.html /index.php;
}

location / {
  rewrite "^/category-([0-9]{1,}).html$" /index.php?routeid=$1&ifalias=n&file=category&page=1;
  rewrite "^/category-([0-9]{1,})-([0-9]{1,}).html$" /index.php?routeid=$1&ifalias=n&file=category&page=$2;
  rewrite "^/detail-([0-9]{1,}).html$" /index.php?detailid=$1&ifalias=n&file=category;
  rewrite "^/tag-([0-9]{1,}).html$" /index.php?routeid=$1&ifalias=n&file=tag&page=1;
  rewrite "^/tag-([0-9]{1,})-([0-9]{1,}).html$" /index.php?routeid=$1&ifalias=n&file=tag&page=$2;
  rewrite "^/dmlink-([a-z0-9A-Z_]{1,})-([a-z0-9A-Z_]{1,})-([a-z0-9A-Z_]{1,}).html$" /index.php?file=$1&alias=$2&page=$3;
  rewrite "^/page-([0-9]{1,}).html$" /index.php?routeid=$1&ifalias=n&file=page&page=1;
  rewrite "^/([a-z0-9A-Z-_]{1,})-([0-9]{1,}).html$" /index.php?alias=$1&ifalias=y&file=alias&page=$2;
  rewrite "^/([a-z0-9A-Z-_]{1,}).html$" /index.php?alias=$1&ifalias=y&file=alias&page=1;
}