全球主机交流论坛
标题:
50金币帮忙转换.htaccess为nginx规则
[打印本页]
作者:
shineme
时间:
2013-10-10 20:27
标题:
50金币帮忙转换.htaccess为nginx规则
RewriteRule ^popular/List_([A-Z])/p([0-9]+).html$ index.php?main_page=tags&type=$1&page=$2&%{QUERY_STRING} [L]
RewriteRule ^popular/List_([A-Z])[/]{0,1}$ index.php?main_page=tags&type=$1&%{QUERY_STRING} [L]
RewriteRule ^popular/([^/]+)[/]{0,1}$ index.php?main_page=tags_keywords&key_id=$1&%{QUERY_STRING} [L]
RewriteRule ^popular/([^/]+)[/]{0,1}/p([0-9]+).html$ index.php?main_page=tags_keywords&key_id=$1&page=$2&%{QUERY_STRING} [L]
RewriteRule ^popular/([^/]+)/([^/]+)[/]{0,1}$ index.php?main_page=tags_keywords&attr=$1&key_id=$2&%{QUERY_STRING} [L]
RewriteRule ^popular[/]{0,1}$ index.php?main_page=tags_all [L]
RewriteRule ^producttags/(.*)$ index.php?main_page=producttags&letter=$1&language=en&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/producttags/(.*)$ index.php?main_page=producttags&letter=$2&language=$1&%{QUERY_STRING} [L]
#RewriteRule ^([a-zA-Z]{2})/producttags/(.*)/([0-9]+).html$ index.php?main_page=producttags&letter=$2&page=$3&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/([w])/([0-9]+).html$ index.php?main_page=producttags&letter=$2&page=$3&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/producttags/0-9$ index.php?main_page=producttags&letter=0-9&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/producttags/0-9/([0-9]+).html$ index.php?main_page=producttags&letter=0-9&page=$2&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/$ index.php?main_page=&language=$1&%{QUERY_STRING} [L]
#RewriteRule ^([a-zA-Z]{2})/(.*).html$ index.php?main_page=$2&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/about_us.html$ index.php?main_page=about_us&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/contact_us.html$ index.php?main_page=contact_us&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/best_deal.html$ index.php?main_page=best_deal&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/products_featured.html$ index.php?main_page=products_featured&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/products_new.html$ index.php?main_page=products_new&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/faq.html$ index.php?main_page=faq&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/faqs_all.html$ index.php?main_page=faqs_all&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/faq_info.html$ index.php?main_page=faq_info&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/faqs_submit.html$ index.php?main_page=faqs_submit&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/site_map.html$ index.php?main_page=site_map&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/privacy.html$ index.php?main_page=privacy&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/term_of_use.html$ index.php?main_page=term_of_use&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/reviews.html$ index.php?main_page=reviews&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/rss_feed.html$ index.php?main_page=rss_feed&language=$1&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z]{2})/promotions.html$ index.php?main_page=promotions&language=$1&%{QUERY_STRING} [L]
RewriteRule ^print_page_p(.*)$ index.php?main_page=print_page&products_id=$1&language=en&%{QUERY_STRING} [L]
RewriteRule ^(.*)/print_page_p(.*)$ index.php?main_page=print_page&products_id=$2&language=$1&%{QUERY_STRING} [L]
RewriteRule ^(.*)-p-(.*).html$ index.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c(.*)/p([0-9]+)$ index.php?main_page=index&cPath=$2&page=$3&%{QUERY_STRING} [L]
#RewriteRule ^(.*)-c([0-9]+)$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)/(.*)-c(.*)$ index.php?main_page=index&attr=$1&cPath=$3&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c(.*)$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c([0-9]+)/(.*)/(.*).html$ index.php?main_page=index&cPath=$2&display=$3&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+).html$ index.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+).html$ index.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+).html$ index.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+).html$ index.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^wishlist/$ index.php?main_page=wishlist [L]
RewriteRule ^wishlist/(.*)$ index.php?main_page=wishlist&letter=$1&%{QUERY_STRING} [L]
RewriteRule ^wishlist/(.*)/([0-9]+).html$ index.php?main_page=wishlist&letter=$1&page=$2&%{QUERY_STRING} [L]
RewriteRule ^promotions/([0-9]+).html$ index.php?main_page=promotions&page=$1&%{QUERY_STRING} [L]
RewriteRule ^news/?$ index.php?main_page=news&%{QUERY_STRING} [L]
RewriteRule ^news/rss.xml$ index.php?main_page=news_rss&%{QUERY_STRING} [L]
RewriteRule ^news/archive/?$ index.php?main_page=news_archive&%{QUERY_STRING} [L]
RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+).html$ index.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index.php?main_page=$1&%{QUERY_STRING} [L]
复制代码
作者:
star826
时间:
2013-10-10 20:27
提示:
作者被禁止或删除 内容自动屏蔽
作者:
star826
时间:
2013-10-10 20:31
提示:
作者被禁止或删除 内容自动屏蔽
作者:
leelei
时间:
2013-10-10 20:32
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
这个可以收着以后用
自己转
rewrite ^/popular/List_([A-Z])/p([0-9]+).html$ /index.php?main_page=tags&type=$1&page=$2&$args last;
rewrite ^/popular/List_([A-Z])[/]{0,1}$ /index.php?main_page=tags&type=$1&$args last;
rewrite ^/popular/([^/]+)[/]{0,1}$ /index.php?main_page=tags_keywords&key_id=$1&$args last;
rewrite ^/popular/([^/]+)[/]{0,1}/p([0-9]+).html$ /index.php?main_page=tags_keywords&key_id=$1&page=$2&$args last;
rewrite ^/popular/([^/]+)/([^/]+)[/]{0,1}$ /index.php?main_page=tags_keywords&attr=$1&key_id=$2&$args last;
rewrite ^/popular[/]{0,1}$ /index.php?main_page=tags_all last;
rewrite ^/producttags/(.*)$ /index.php?main_page=producttags&letter=$1&language=en&$args last;
rewrite ^/([a-zA-Z]{2})/producttags/(.*)$ /index.php?main_page=producttags&letter=$2&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/([w])/([0-9]+).html$ /index.php?main_page=producttags&letter=$2&page=$3&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/producttags/0-9$ /index.php?main_page=producttags&letter=0-9&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/producttags/0-9/([0-9]+).html$ /index.php?main_page=producttags&letter=0-9&page=$2&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/$ /index.php?main_page=&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/about_us.html$ /index.php?main_page=about_us&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/contact_us.html$ /index.php?main_page=contact_us&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/best_deal.html$ /index.php?main_page=best_deal&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/products_featured.html$ /index.php?main_page=products_featured&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/products_new.html$ /index.php?main_page=products_new&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/faq.html$ /index.php?main_page=faq&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/faqs_all.html$ /index.php?main_page=faqs_all&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/faq_info.html$ /index.php?main_page=faq_info&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/faqs_submit.html$ /index.php?main_page=faqs_submit&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/site_map.html$ /index.php?main_page=site_map&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/privacy.html$ /index.php?main_page=privacy&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/term_of_use.html$ /index.php?main_page=term_of_use&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/reviews.html$ /index.php?main_page=reviews&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/rss_feed.html$ /index.php?main_page=rss_feed&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/promotions.html$ /index.php?main_page=promotions&language=$1&$args last;
rewrite ^/print_page_p(.*)$ /index.php?main_page=print_page&products_id=$1&language=en&$args last;
rewrite ^/(.*)/print_page_p(.*)$ /index.php?main_page=print_page&products_id=$2&language=$1&$args last;
rewrite ^/(.*)-p-(.*).html$ /index.php?main_page=product_info&products_id=$2&$args last;
rewrite ^/(.*)-c(.*)/p([0-9]+)$ /index.php?main_page=index&cPath=$2&page=$3&$args last;
rewrite ^/(.*)/(.*)-c(.*)$ /index.php?main_page=index&attr=$1&cPath=$3&$args last;
rewrite ^/(.*)-c(.*)$ /index.php?main_page=index&cPath=$2&$args last;
rewrite ^/(.*)-c([0-9]+)/(.*)/(.*).html$ /index.php?main_page=index&cPath=$2&display=$3&$args last;
rewrite ^/(.*)-m-([0-9]+).html$ /index.php?main_page=index&manufacturers_id=$2&$args last;
rewrite ^/(.*)-pi-([0-9]+).html$ /index.php?main_page=popup_image&pID=$2&$args last;
rewrite ^/(.*)-pr-([0-9]+).html$ /index.php?main_page=product_reviews&products_id=$2&$args last;
rewrite ^/(.*)-pri-([0-9]+).html$ /index.php?main_page=product_reviews_info&products_id=$2&$args last;
rewrite ^/wishlist/$ /index.php?main_page=wishlist last;
rewrite ^/wishlist/(.*)$ /index.php?main_page=wishlist&letter=$1&$args last;
rewrite ^/wishlist/(.*)/([0-9]+).html$ /index.php?main_page=wishlist&letter=$1&page=$2&$args last;
rewrite ^/promotions/([0-9]+).html$ /index.php?main_page=promotions&page=$1&$args last;
rewrite ^/news/?$ /index.php?main_page=news&$args last;
rewrite ^/news/rss.xml$ /index.php?main_page=news_rss&$args last;
rewrite ^/news/archive/?$ /index.php?main_page=news_archive&$args last;
rewrite ^/news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ /index.php?main_page=news&date=$1-$2-$3&$args last;
rewrite ^/news/archive/([0-9]{4})-([0-9]{2}).html$ /index.php?main_page=news_archive&date=$1-$2&$args last;
rewrite ^/news/(.*)-a-([0-9]+)-comments.html$ /index.php?main_page=news_comments&article_id=$2&$args last;
rewrite ^/news/(.*)-a-([0-9]+).html$ /index.php?main_page=news_article&article_id=$2&$args last;
if (!-f $request_filename){
set $rule_49 1$rule_49;
}
if (!-d $request_filename){
set $rule_49 2$rule_49;
}
if ($rule_49 = "21"){
rewrite ^/(.*).html$ /index.php?main_page=$1&$args last;
}
复制代码
作者:
shineme
时间:
2013-10-10 20:33
star826 发表于 2013-10-10 20:31
有错误。你从网上转了直接复制?
作者:
star826
时间:
2013-10-10 20:39
提示:
作者被禁止或删除 内容自动屏蔽
作者:
orvice
时间:
2013-10-10 20:54
rewrite ^/popular/List_([A-Z])/p([0-9]+).html$ /index.php?main_page=tags&type=$1&page=$2&$args last;
rewrite ^/popular/List_([A-Z])[/]{0,1}$ /index.php?main_page=tags&type=$1&$args last;
rewrite ^/popular/([^/]+)[/]{0,1}$ /index.php?main_page=tags_keywords&key_id=$1&$args last;
rewrite ^/popular/([^/]+)[/]{0,1}/p([0-9]+).html$ /index.php?main_page=tags_keywords&key_id=$1&page=$2&$args last;
rewrite ^/popular/([^/]+)/([^/]+)[/]{0,1}$ /index.php?main_page=tags_keywords&attr=$1&key_id=$2&$args last;
rewrite ^/popular[/]{0,1}$ /index.php?main_page=tags_all last;
rewrite ^/producttags/(.*)$ /index.php?main_page=producttags&letter=$1&language=en&$args last;
rewrite ^/([a-zA-Z]{2})/producttags/(.*)$ /index.php?main_page=producttags&letter=$2&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/([w])/([0-9]+).html$ /index.php?main_page=producttags&letter=$2&page=$3&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/producttags/0-9$ /index.php?main_page=producttags&letter=0-9&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/producttags/0-9/([0-9]+).html$ /index.php?main_page=producttags&letter=0-9&page=$2&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/$ /index.php?main_page=&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/about_us.html$ /index.php?main_page=about_us&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/contact_us.html$ /index.php?main_page=contact_us&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/best_deal.html$ /index.php?main_page=best_deal&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/products_featured.html$ /index.php?main_page=products_featured&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/products_new.html$ /index.php?main_page=products_new&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/faq.html$ /index.php?main_page=faq&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/faqs_all.html$ /index.php?main_page=faqs_all&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/faq_info.html$ /index.php?main_page=faq_info&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/faqs_submit.html$ /index.php?main_page=faqs_submit&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/site_map.html$ /index.php?main_page=site_map&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/privacy.html$ /index.php?main_page=privacy&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/term_of_use.html$ /index.php?main_page=term_of_use&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/reviews.html$ /index.php?main_page=reviews&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/rss_feed.html$ /index.php?main_page=rss_feed&language=$1&$args last;
rewrite ^/([a-zA-Z]{2})/promotions.html$ /index.php?main_page=promotions&language=$1&$args last;
rewrite ^/print_page_p(.*)$ /index.php?main_page=print_page&products_id=$1&language=en&$args last;
rewrite ^/(.*)/print_page_p(.*)$ /index.php?main_page=print_page&products_id=$2&language=$1&$args last;
rewrite ^/(.*)-p-(.*).html$ /index.php?main_page=product_info&products_id=$2&$args last;
rewrite ^/(.*)-c(.*)/p([0-9]+)$ /index.php?main_page=index&cPath=$2&page=$3&$args last;
rewrite ^/(.*)/(.*)-c(.*)$ /index.php?main_page=index&attr=$1&cPath=$3&$args last;
rewrite ^/(.*)-c(.*)$ /index.php?main_page=index&cPath=$2&$args last;
rewrite ^/(.*)-c([0-9]+)/(.*)/(.*).html$ /index.php?main_page=index&cPath=$2&display=$3&$args last;
rewrite ^/(.*)-m-([0-9]+).html$ /index.php?main_page=index&manufacturers_id=$2&$args last;
rewrite ^/(.*)-pi-([0-9]+).html$ /index.php?main_page=popup_image&pID=$2&$args last;
rewrite ^/(.*)-pr-([0-9]+).html$ /index.php?main_page=product_reviews&products_id=$2&$args last;
rewrite ^/(.*)-pri-([0-9]+).html$ /index.php?main_page=product_reviews_info&products_id=$2&$args last;
rewrite ^/wishlist/$ /index.php?main_page=wishlist last;
rewrite ^/wishlist/(.*)$ /index.php?main_page=wishlist&letter=$1&$args last;
rewrite ^/wishlist/(.*)/([0-9]+).html$ /index.php?main_page=wishlist&letter=$1&page=$2&$args last;
rewrite ^/promotions/([0-9]+).html$ /index.php?main_page=promotions&page=$1&$args last;
rewrite ^/news/?$ /index.php?main_page=news&$args last;
rewrite ^/news/rss.xml$ /index.php?main_page=news_rss&$args last;
rewrite ^/news/archive/?$ /index.php?main_page=news_archive&$args last;
rewrite ^/news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ /index.php?main_page=news&date=$1-$2-$3&$args last;
rewrite ^/news/archive/([0-9]{4})-([0-9]{2}).html$ /index.php?main_page=news_archive&date=$1-$2&$args last;
rewrite ^/news/(.*)-a-([0-9]+)-comments.html$ /index.php?main_page=news_comments&article_id=$2&$args last;
rewrite ^/news/(.*)-a-([0-9]+).html$ /index.php?main_page=news_article&article_id=$2&$args last;
if (!-f $request_filename){
set $rule_49 1$rule_49;
}
if (!-d $request_filename){
set $rule_49 2$rule_49;
}
if ($rule_49 = "21"){
rewrite ^/(.*).html$ /index.php?main_page=$1&$args last;
}
复制代码
作者:
star826
时间:
2013-10-10 21:34
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 全球主机交流论坛 (https://443502.xyz/)
Powered by Discuz! X3.4