ballpen 发表于 2018-5-25 11:27:47

哪位大神帮看下 这个apache规则,怎么转 nginx

宝塔的工具, 在线的工具,转了 没法用,,




RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1
RewriteRule ^(.*)/item/(.*)\.html$ $1/product/Index/id/$2
RewriteRule ^(.*)/about/$ $1/page/index/id/45.html
RewriteRule ^(.*)/brand/(.*)\.html$ $1/product/brand/id/$2
RewriteRule ^(.*)/help/$ $1/page/index/id/36.html
RewriteRule ^(.*)/help/question.html$ $1/page/index/id/35.html
RewriteRule ^(.*)/info/news.html$ $1/portal/list/index/id/6.html
RewriteRule ^(.*)/info/news.html?p=(.*)\$ $1/portal/list/index/id/6/p/$2.html
RewriteRule ^(.*)/info/sub.html$ $1/portal/list/index/id/7.html
RewriteRule ^(.*)/info/sub.html?p=(.*)\$ $1/portal/list/index/id/7/p/$2.html



怎么转 nginx

callmefeifei 发表于 2018-5-25 11:29:26

location / {
if (!-e $request_filename){
    rewrite ^(.*)$ /index.php/$1 break;
}
rewrite ^/(.*)/item/(.*)\.html$ /$1/product/Index/id/$2 break;
rewrite ^/(.*)/about/$ /$1/page/index/id/45.html break;
rewrite ^/(.*)/brand/(.*)\.html$ /$1/product/brand/id/$2 break;
rewrite ^/(.*)/help/$ /$1/page/index/id/36.html break;
rewrite ^/(.*)/help/question.html$ /$1/page/index/id/35.html break;
rewrite ^/(.*)/info/news.html$ /$1/portal/list/index/id/6.html break;
rewrite ^/(.*)/info/news.html?p=(.*)\$ /$1/portal/list/index/id/p/$2.html break;
rewrite ^/(.*)/info/sub.html$ /$1/portal/list/index/id/7.html break;
rewrite ^/(.*)/info/sub.html?p=(.*)\$ /$1/portal/list/index/id/p/$2.html break;
}

Crying 发表于 2018-5-25 11:31:33

2楼是大佬,楼主不送分?
页: [1]
查看完整版本: 哪位大神帮看下 这个apache规则,怎么转 nginx