蚂蚁分类信息系统伪静态多城市版nginx规则自适应URL
蚂蚁分类信息系统伪静态多城市版nginx规则自适应URL,支持二级域名,包含信息、文章、商家、店铺、商城
if ( $http_user_agent ~ "(MIDP)|(WAP)|(UP.Browser)|(Smartphone)|(Obigo)|(Mobile)|(AU.Browser)|(wxd.Mms)|(WxdB.Browser)|(CLDC)|(UP.Link)|(KM.Browser)|(UCWEB)|(SEMC-Browser)|(Mini)|(Symbian)|(Palm)|(Nokia)|(Panasonic)|(MOT-)|(SonyEricsson)|(NEC-)|(Alcatel)|(Ericsson)|(BENQ)|(BenQ)|(Amoisonic)|(Amoi-)|(Capitel)|(PHILIPS)|(SAMSUNG)|(Lenovo)|(Mitsu)|(Motorola)|(SHARP)|(WAPPER)|(LG-)|(LG/)|(EG900)|(CECT)|(Compal)|(kejian)|(Bird)|(BIRD)|(G900/V1.0)|(Arima)|(CTL)|(TDG)|(Daxian)|(DAXIAN)|(DBTEL)|(Eastcom)|(EASTCOM)|(PANTECH)|(Dopod)|(Haier)|(HAIER)|(KONKA)|(KEJIAN)|(LENOVO)|(Soutec)|(SOUTEC)|(SAGEM)|(SEC-)|(SED-)|(EMOL-)|(INNO55)|(ZTE)|(iPhone)|(Android)|(Windows CE)|(Wget)|(Java)|(curl)|(Opera)" ) {
rewrite ^/(.*[\/]?)city/$ /m/?mod=changecity&cityid=0 last;rewrite ^/(.*[\/]?)news.html$ /m/index.php?mod=news last;
rewrite ^/(.*[\/]?)news-page-([0-9]+).html$ /m/index.php?mod=news&page=$2 last;
rewrite ^/(.*[\/]?)news/([0-9]+).html$ /m/index.php?mod=news&id=$2 last;
rewrite ^/(.*[\/]?)history.html$ /m/index.php?mod=history last;
rewrite ^/(.*[\/]?)news-id-([0-9]+).html$ /m/index.php?mod=news&id=$2 last;
rewrite ^/(.*[\/]?)news-catid-([0-9]+).html$ /m/index.php?mod=news&catid=$2 last;
rewrite ^/(.*[\/]?)news-catid-([0-9]+)-page-([0-9]+).html$ /m/index.php?mod=news&catid=$2&page=$3 last;
rewrite ^/(.*[\/]?)aboutus.html$ /m/index.php?mod=aboutus last;
rewrite ^/(.*[\/]?)aboutus-id-([0-9]+).html$ /m/index.php?mod=aboutus&id=$2 last;
rewrite ^/(.*[\/]?)announce.html$ /m/index.php?mod=announce last;
rewrite ^/(.*[\/]?)announce-id-([0-9]+).html$ /m/index.php?mod=announce&id=$2 last;
rewrite ^/(.*[\/]?)goods.html$ /m/index.php?mod=goods last;
rewrite ^/(.*[\/]?)goods-id-([0-9]+).html$ /m/index.php?mod=goods&id=$2 last;
rewrite ^/(.*[\/]?)goods-([^\/]+).html$ /m/index.php?mod=goods&Catid=$2 last;
rewrite ^/(.*[\/]?)corporation.html$ /m/index.php?mod=corp last;
rewrite ^/(.*[\/]?)corporation-([^\/]+)\.html$ /m/index.php?mod=corp&Catid=$2 last;
rewrite ^/(.*[\/]?)store-([0-9]+)/$ /m/index.php?mod=store&id=$2 last;
rewrite ^/(.*[\/]?)store-([0-9]+)\/([^\/]+).html$ /m/index.php?mod=store&id=$2&Uid=$3 last;
rewrite ^/(.*[\/]?)store-([0-9]+)/document-id-([0-9]+).html$ /m/index.php?mod=store&id=$2&action=document&docuid=$3 last;
rewrite ^/(.*[\/]?)store-([0-9]+)/document-typeid-([0-9]+).html$ /m/index.php?mod=store&id=$2&action=document&typeid=$3 last;
rewrite ^/category/$ /m/index.php?mod=category last;
rewrite ^/(.+)/$ /m/index.php?mod=category&Catid=$1 last;
rewrite ^/(?!store|space|news)(.+[\/]?.+)/$ /m/index.php?mod=category&Catid=$1 last;
rewrite ^/(.+[\/]?.+)/([0-9]+).html$ /m/index.php?mod=information&id=$2 last;
rewrite ^/index.php(.*)$ /m/index.php$1 last;
rewrite ^/index.html(.*)$ /m/index.php$1 last;
}
rewrite ^/(.*[\/]?)city/$ /changecity.php last;
rewrite ^/(.*[\/]?)news.html$ /news.php?cityname=$1 last;
rewrite ^/(.*[\/]?)news/([0-9]+).html$ /news.php?cityname=$1&id=$2 last;
rewrite ^/(.*[\/]?)news-catid-([0-9]+).html$ /news.php?cityname=$1&catid=$2 last;
rewrite ^/(.*[\/]?)news-catid-([0-9]+)-page-([0-9]+).html$ /news.php?cityname=$1&catid=$2&page=$3 last;
rewrite ^/sitemap/$ /about.php?part=sitemap last;
rewrite ^/sitemap.html$ /about.php?part=sitemap last;
rewrite ^/aboutus.html$ /about.php?part=aboutus last;
rewrite ^/aboutus-id-([0-9]+).html$ /about.php?part=aboutus&id=$1 last;
rewrite ^/announce.html$ /about.php?part=announce last;
rewrite ^/announce-id-([0-9]+).html$ /about.php?part=announce&id=$1 last;
rewrite ^/faq.html$ /about.php?part=faq last;
rewrite ^/faq-id-([0-9]+).html$ /about.php?part=faq&id=$1 last;
rewrite ^/friendlink.html$ /about.php?part=friendlink last;
rewrite ^/(.*[\/]?)goods/$ /goods.php last;
rewrite ^/(.*[\/]?)goods-id-([0-9]+).html$ /goods.php?id=$2 last;
rewrite ^/(.*[\/]?)goods-([^\/]+).html$ /goods.php?Catid=$2 last;
rewrite ^/(.*[\/]?)space/(.+)\/$ /space.php?user=$2 last;
rewrite ^/(.*[\/]?)store-([0-9]+)\/$ /store.php?uid=$2 last;
rewrite ^/(.*[\/]?)store-([0-9]+)\/([^\/]+).html$ /store.php?uid=$2&Uid=$3 last;
rewrite ^/(.*[\/]?)corporation.html$ /corporation.php last;
rewrite ^/(.*[\/]?)corporation-([^\/]+)\.html$ /corporation.php?Catid=$2 last;
if (!-d $request_filename){
rewrite ^/(?!store|space|news)(.+[\/]?.+)/$ /category.php?Catid=$1 last;
}
if (!-d $request_filename){
rewrite "^/([a-z|A-Z|0-9]{2,})$" /index.php?cityname=$1 last;
}
rewrite ^/(.+[\/]?.+)/([0-9]+).html$ /information.php?id=$2 last;