|
|
发表于 2013-10-10 20:32:50
|
显示全部楼层
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;
- }
复制代码 |
|