宇宙主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

欧基零壹微头条IP归属甄别会员请立即修改密码
查看: 2041|回复: 7

50金币帮忙转换.htaccess为nginx规则

[复制链接]
发表于 2013-10-10 20:27:09 | 显示全部楼层 |阅读模式
50金钱
  1. RewriteRule ^popular/List_([A-Z])/p([0-9]+).html$ index.php?main_page=tags&type=$1&page=$2&%{QUERY_STRING} [L]
  2. RewriteRule ^popular/List_([A-Z])[/]{0,1}$ index.php?main_page=tags&type=$1&%{QUERY_STRING} [L]
  3. RewriteRule ^popular/([^/]+)[/]{0,1}$ index.php?main_page=tags_keywords&key_id=$1&%{QUERY_STRING} [L]
  4. RewriteRule ^popular/([^/]+)[/]{0,1}/p([0-9]+).html$ index.php?main_page=tags_keywords&key_id=$1&page=$2&%{QUERY_STRING} [L]
  5. RewriteRule ^popular/([^/]+)/([^/]+)[/]{0,1}$ index.php?main_page=tags_keywords&attr=$1&key_id=$2&%{QUERY_STRING} [L]

  6. RewriteRule ^popular[/]{0,1}$ index.php?main_page=tags_all [L]


  7. RewriteRule ^producttags/(.*)$ index.php?main_page=producttags&letter=$1&language=en&%{QUERY_STRING} [L]
  8. RewriteRule ^([a-zA-Z]{2})/producttags/(.*)$ index.php?main_page=producttags&letter=$2&language=$1&%{QUERY_STRING} [L]
  9. #RewriteRule ^([a-zA-Z]{2})/producttags/(.*)/([0-9]+).html$ index.php?main_page=producttags&letter=$2&page=$3&language=$1&%{QUERY_STRING} [L]
  10. RewriteRule ^([a-zA-Z]{2})/([w])/([0-9]+).html$ index.php?main_page=producttags&letter=$2&page=$3&language=$1&%{QUERY_STRING} [L]
  11. RewriteRule ^([a-zA-Z]{2})/producttags/0-9$ index.php?main_page=producttags&letter=0-9&language=$1&%{QUERY_STRING} [L]
  12. 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]


  13. RewriteRule ^([a-zA-Z]{2})/$ index.php?main_page=&language=$1&%{QUERY_STRING} [L]
  14. #RewriteRule ^([a-zA-Z]{2})/(.*).html$ index.php?main_page=$2&language=$1&%{QUERY_STRING} [L]
  15. RewriteRule ^([a-zA-Z]{2})/about_us.html$ index.php?main_page=about_us&language=$1&%{QUERY_STRING} [L]
  16. RewriteRule ^([a-zA-Z]{2})/contact_us.html$ index.php?main_page=contact_us&language=$1&%{QUERY_STRING} [L]
  17. RewriteRule ^([a-zA-Z]{2})/best_deal.html$ index.php?main_page=best_deal&language=$1&%{QUERY_STRING} [L]
  18. RewriteRule ^([a-zA-Z]{2})/products_featured.html$ index.php?main_page=products_featured&language=$1&%{QUERY_STRING} [L]
  19. RewriteRule ^([a-zA-Z]{2})/products_new.html$ index.php?main_page=products_new&language=$1&%{QUERY_STRING} [L]
  20. RewriteRule ^([a-zA-Z]{2})/faq.html$ index.php?main_page=faq&language=$1&%{QUERY_STRING} [L]
  21. RewriteRule ^([a-zA-Z]{2})/faqs_all.html$ index.php?main_page=faqs_all&language=$1&%{QUERY_STRING} [L]
  22. RewriteRule ^([a-zA-Z]{2})/faq_info.html$ index.php?main_page=faq_info&language=$1&%{QUERY_STRING} [L]
  23. RewriteRule ^([a-zA-Z]{2})/faqs_submit.html$ index.php?main_page=faqs_submit&language=$1&%{QUERY_STRING} [L]
  24. RewriteRule ^([a-zA-Z]{2})/site_map.html$ index.php?main_page=site_map&language=$1&%{QUERY_STRING} [L]
  25. RewriteRule ^([a-zA-Z]{2})/privacy.html$ index.php?main_page=privacy&language=$1&%{QUERY_STRING} [L]
  26. RewriteRule ^([a-zA-Z]{2})/term_of_use.html$ index.php?main_page=term_of_use&language=$1&%{QUERY_STRING} [L]
  27. RewriteRule ^([a-zA-Z]{2})/reviews.html$ index.php?main_page=reviews&language=$1&%{QUERY_STRING} [L]
  28. RewriteRule ^([a-zA-Z]{2})/rss_feed.html$ index.php?main_page=rss_feed&language=$1&%{QUERY_STRING} [L]
  29. RewriteRule ^([a-zA-Z]{2})/promotions.html$ index.php?main_page=promotions&language=$1&%{QUERY_STRING} [L]

  30. RewriteRule ^print_page_p(.*)$ index.php?main_page=print_page&products_id=$1&language=en&%{QUERY_STRING} [L]
  31. RewriteRule ^(.*)/print_page_p(.*)$ index.php?main_page=print_page&products_id=$2&language=$1&%{QUERY_STRING} [L]
  32. RewriteRule ^(.*)-p-(.*).html$ index.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
  33. RewriteRule ^(.*)-c(.*)/p([0-9]+)$ index.php?main_page=index&cPath=$2&page=$3&%{QUERY_STRING} [L]
  34. #RewriteRule ^(.*)-c([0-9]+)$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
  35. RewriteRule ^(.*)/(.*)-c(.*)$ index.php?main_page=index&attr=$1&cPath=$3&%{QUERY_STRING} [L]
  36. RewriteRule ^(.*)-c(.*)$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
  37. RewriteRule ^(.*)-c([0-9]+)/(.*)/(.*).html$ index.php?main_page=index&cPath=$2&display=$3&%{QUERY_STRING} [L]
  38. RewriteRule ^(.*)-m-([0-9]+).html$ index.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
  39. RewriteRule ^(.*)-pi-([0-9]+).html$ index.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
  40. RewriteRule ^(.*)-pr-([0-9]+).html$ index.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
  41. RewriteRule ^(.*)-pri-([0-9]+).html$ index.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]






  42. RewriteRule ^wishlist/$ index.php?main_page=wishlist [L]
  43. RewriteRule ^wishlist/(.*)$ index.php?main_page=wishlist&letter=$1&%{QUERY_STRING} [L]
  44. RewriteRule ^wishlist/(.*)/([0-9]+).html$ index.php?main_page=wishlist&letter=$1&page=$2&%{QUERY_STRING} [L]

  45. RewriteRule ^promotions/([0-9]+).html$ index.php?main_page=promotions&page=$1&%{QUERY_STRING} [L]

  46. RewriteRule ^news/?$ index.php?main_page=news&%{QUERY_STRING} [L]
  47. RewriteRule ^news/rss.xml$ index.php?main_page=news_rss&%{QUERY_STRING} [L]
  48. RewriteRule ^news/archive/?$ index.php?main_page=news_archive&%{QUERY_STRING} [L]
  49. RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
  50. RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
  51. RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
  52. RewriteRule ^news/(.*)-a-([0-9]+).html$ index.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]

  53. RewriteCond %{REQUEST_FILENAME} !-f [NC]
  54. RewriteCond %{REQUEST_FILENAME} !-d
  55. RewriteRule ^(.*).html$ index.php?main_page=$1&%{QUERY_STRING} [L]
复制代码
发表于 2013-10-10 20:27:10 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2013-10-10 20:31:38 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2013-10-10 20:32:50 | 显示全部楼层
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
这个可以收着以后用
自己转
  1.         rewrite ^/popular/List_([A-Z])/p([0-9]+).html$ /index.php?main_page=tags&type=$1&page=$2&$args last;
  2.         rewrite ^/popular/List_([A-Z])[/]{0,1}$ /index.php?main_page=tags&type=$1&$args last;
  3.         rewrite ^/popular/([^/]+)[/]{0,1}$ /index.php?main_page=tags_keywords&key_id=$1&$args last;
  4.         rewrite ^/popular/([^/]+)[/]{0,1}/p([0-9]+).html$ /index.php?main_page=tags_keywords&key_id=$1&page=$2&$args last;
  5.         rewrite ^/popular/([^/]+)/([^/]+)[/]{0,1}$ /index.php?main_page=tags_keywords&attr=$1&key_id=$2&$args last;
  6.         rewrite ^/popular[/]{0,1}$ /index.php?main_page=tags_all last;
  7.         rewrite ^/producttags/(.*)$ /index.php?main_page=producttags&letter=$1&language=en&$args last;
  8.         rewrite ^/([a-zA-Z]{2})/producttags/(.*)$ /index.php?main_page=producttags&letter=$2&language=$1&$args last;
  9.         rewrite ^/([a-zA-Z]{2})/([w])/([0-9]+).html$ /index.php?main_page=producttags&letter=$2&page=$3&language=$1&$args last;
  10.         rewrite ^/([a-zA-Z]{2})/producttags/0-9$ /index.php?main_page=producttags&letter=0-9&language=$1&$args last;
  11.         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;
  12.         rewrite ^/([a-zA-Z]{2})/$ /index.php?main_page=&language=$1&$args last;
  13.         rewrite ^/([a-zA-Z]{2})/about_us.html$ /index.php?main_page=about_us&language=$1&$args last;
  14.         rewrite ^/([a-zA-Z]{2})/contact_us.html$ /index.php?main_page=contact_us&language=$1&$args last;
  15.         rewrite ^/([a-zA-Z]{2})/best_deal.html$ /index.php?main_page=best_deal&language=$1&$args last;
  16.         rewrite ^/([a-zA-Z]{2})/products_featured.html$ /index.php?main_page=products_featured&language=$1&$args last;
  17.         rewrite ^/([a-zA-Z]{2})/products_new.html$ /index.php?main_page=products_new&language=$1&$args last;
  18.         rewrite ^/([a-zA-Z]{2})/faq.html$ /index.php?main_page=faq&language=$1&$args last;
  19.         rewrite ^/([a-zA-Z]{2})/faqs_all.html$ /index.php?main_page=faqs_all&language=$1&$args last;
  20.         rewrite ^/([a-zA-Z]{2})/faq_info.html$ /index.php?main_page=faq_info&language=$1&$args last;
  21.         rewrite ^/([a-zA-Z]{2})/faqs_submit.html$ /index.php?main_page=faqs_submit&language=$1&$args last;
  22.         rewrite ^/([a-zA-Z]{2})/site_map.html$ /index.php?main_page=site_map&language=$1&$args last;
  23.         rewrite ^/([a-zA-Z]{2})/privacy.html$ /index.php?main_page=privacy&language=$1&$args last;
  24.         rewrite ^/([a-zA-Z]{2})/term_of_use.html$ /index.php?main_page=term_of_use&language=$1&$args last;
  25.         rewrite ^/([a-zA-Z]{2})/reviews.html$ /index.php?main_page=reviews&language=$1&$args last;
  26.         rewrite ^/([a-zA-Z]{2})/rss_feed.html$ /index.php?main_page=rss_feed&language=$1&$args last;
  27.         rewrite ^/([a-zA-Z]{2})/promotions.html$ /index.php?main_page=promotions&language=$1&$args last;
  28.         rewrite ^/print_page_p(.*)$ /index.php?main_page=print_page&products_id=$1&language=en&$args last;
  29.         rewrite ^/(.*)/print_page_p(.*)$ /index.php?main_page=print_page&products_id=$2&language=$1&$args last;
  30.         rewrite ^/(.*)-p-(.*).html$ /index.php?main_page=product_info&products_id=$2&$args last;
  31.         rewrite ^/(.*)-c(.*)/p([0-9]+)$ /index.php?main_page=index&cPath=$2&page=$3&$args last;
  32.         rewrite ^/(.*)/(.*)-c(.*)$ /index.php?main_page=index&attr=$1&cPath=$3&$args last;
  33.         rewrite ^/(.*)-c(.*)$ /index.php?main_page=index&cPath=$2&$args last;
  34.         rewrite ^/(.*)-c([0-9]+)/(.*)/(.*).html$ /index.php?main_page=index&cPath=$2&display=$3&$args last;
  35.         rewrite ^/(.*)-m-([0-9]+).html$ /index.php?main_page=index&manufacturers_id=$2&$args last;
  36.         rewrite ^/(.*)-pi-([0-9]+).html$ /index.php?main_page=popup_image&pID=$2&$args last;
  37.         rewrite ^/(.*)-pr-([0-9]+).html$ /index.php?main_page=product_reviews&products_id=$2&$args last;
  38.         rewrite ^/(.*)-pri-([0-9]+).html$ /index.php?main_page=product_reviews_info&products_id=$2&$args last;
  39.         rewrite ^/wishlist/$ /index.php?main_page=wishlist last;
  40.         rewrite ^/wishlist/(.*)$ /index.php?main_page=wishlist&letter=$1&$args last;
  41.         rewrite ^/wishlist/(.*)/([0-9]+).html$ /index.php?main_page=wishlist&letter=$1&page=$2&$args last;
  42.         rewrite ^/promotions/([0-9]+).html$ /index.php?main_page=promotions&page=$1&$args last;
  43.         rewrite ^/news/?$ /index.php?main_page=news&$args last;
  44.         rewrite ^/news/rss.xml$ /index.php?main_page=news_rss&$args last;
  45.         rewrite ^/news/archive/?$ /index.php?main_page=news_archive&$args last;
  46.         rewrite ^/news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ /index.php?main_page=news&date=$1-$2-$3&$args last;
  47.         rewrite ^/news/archive/([0-9]{4})-([0-9]{2}).html$ /index.php?main_page=news_archive&date=$1-$2&$args last;
  48.         rewrite ^/news/(.*)-a-([0-9]+)-comments.html$ /index.php?main_page=news_comments&article_id=$2&$args last;
  49.         rewrite ^/news/(.*)-a-([0-9]+).html$ /index.php?main_page=news_article&article_id=$2&$args last;
  50. if (!-f $request_filename){
  51.         set $rule_49 1$rule_49;
  52. }
  53. if (!-d $request_filename){
  54.         set $rule_49 2$rule_49;
  55. }
  56. if ($rule_49 = "21"){
  57.         rewrite ^/(.*).html$ /index.php?main_page=$1&$args last;
  58. }
复制代码
 楼主| 发表于 2013-10-10 20:33:50 | 显示全部楼层

有错误。你从网上转了直接复制?
发表于 2013-10-10 20:39:56 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2013-10-10 20:54:29 | 显示全部楼层
  1.         rewrite ^/popular/List_([A-Z])/p([0-9]+).html$ /index.php?main_page=tags&type=$1&page=$2&$args last;
  2.         rewrite ^/popular/List_([A-Z])[/]{0,1}$ /index.php?main_page=tags&type=$1&$args last;
  3.         rewrite ^/popular/([^/]+)[/]{0,1}$ /index.php?main_page=tags_keywords&key_id=$1&$args last;
  4.         rewrite ^/popular/([^/]+)[/]{0,1}/p([0-9]+).html$ /index.php?main_page=tags_keywords&key_id=$1&page=$2&$args last;
  5.         rewrite ^/popular/([^/]+)/([^/]+)[/]{0,1}$ /index.php?main_page=tags_keywords&attr=$1&key_id=$2&$args last;
  6.         rewrite ^/popular[/]{0,1}$ /index.php?main_page=tags_all last;
  7.         rewrite ^/producttags/(.*)$ /index.php?main_page=producttags&letter=$1&language=en&$args last;
  8.         rewrite ^/([a-zA-Z]{2})/producttags/(.*)$ /index.php?main_page=producttags&letter=$2&language=$1&$args last;
  9.         rewrite ^/([a-zA-Z]{2})/([w])/([0-9]+).html$ /index.php?main_page=producttags&letter=$2&page=$3&language=$1&$args last;
  10.         rewrite ^/([a-zA-Z]{2})/producttags/0-9$ /index.php?main_page=producttags&letter=0-9&language=$1&$args last;
  11.         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;
  12.         rewrite ^/([a-zA-Z]{2})/$ /index.php?main_page=&language=$1&$args last;
  13.         rewrite ^/([a-zA-Z]{2})/about_us.html$ /index.php?main_page=about_us&language=$1&$args last;
  14.         rewrite ^/([a-zA-Z]{2})/contact_us.html$ /index.php?main_page=contact_us&language=$1&$args last;
  15.         rewrite ^/([a-zA-Z]{2})/best_deal.html$ /index.php?main_page=best_deal&language=$1&$args last;
  16.         rewrite ^/([a-zA-Z]{2})/products_featured.html$ /index.php?main_page=products_featured&language=$1&$args last;
  17.         rewrite ^/([a-zA-Z]{2})/products_new.html$ /index.php?main_page=products_new&language=$1&$args last;
  18.         rewrite ^/([a-zA-Z]{2})/faq.html$ /index.php?main_page=faq&language=$1&$args last;
  19.         rewrite ^/([a-zA-Z]{2})/faqs_all.html$ /index.php?main_page=faqs_all&language=$1&$args last;
  20.         rewrite ^/([a-zA-Z]{2})/faq_info.html$ /index.php?main_page=faq_info&language=$1&$args last;
  21.         rewrite ^/([a-zA-Z]{2})/faqs_submit.html$ /index.php?main_page=faqs_submit&language=$1&$args last;
  22.         rewrite ^/([a-zA-Z]{2})/site_map.html$ /index.php?main_page=site_map&language=$1&$args last;
  23.         rewrite ^/([a-zA-Z]{2})/privacy.html$ /index.php?main_page=privacy&language=$1&$args last;
  24.         rewrite ^/([a-zA-Z]{2})/term_of_use.html$ /index.php?main_page=term_of_use&language=$1&$args last;
  25.         rewrite ^/([a-zA-Z]{2})/reviews.html$ /index.php?main_page=reviews&language=$1&$args last;
  26.         rewrite ^/([a-zA-Z]{2})/rss_feed.html$ /index.php?main_page=rss_feed&language=$1&$args last;
  27.         rewrite ^/([a-zA-Z]{2})/promotions.html$ /index.php?main_page=promotions&language=$1&$args last;
  28.         rewrite ^/print_page_p(.*)$ /index.php?main_page=print_page&products_id=$1&language=en&$args last;
  29.         rewrite ^/(.*)/print_page_p(.*)$ /index.php?main_page=print_page&products_id=$2&language=$1&$args last;
  30.         rewrite ^/(.*)-p-(.*).html$ /index.php?main_page=product_info&products_id=$2&$args last;
  31.         rewrite ^/(.*)-c(.*)/p([0-9]+)$ /index.php?main_page=index&cPath=$2&page=$3&$args last;
  32.         rewrite ^/(.*)/(.*)-c(.*)$ /index.php?main_page=index&attr=$1&cPath=$3&$args last;
  33.         rewrite ^/(.*)-c(.*)$ /index.php?main_page=index&cPath=$2&$args last;
  34.         rewrite ^/(.*)-c([0-9]+)/(.*)/(.*).html$ /index.php?main_page=index&cPath=$2&display=$3&$args last;
  35.         rewrite ^/(.*)-m-([0-9]+).html$ /index.php?main_page=index&manufacturers_id=$2&$args last;
  36.         rewrite ^/(.*)-pi-([0-9]+).html$ /index.php?main_page=popup_image&pID=$2&$args last;
  37.         rewrite ^/(.*)-pr-([0-9]+).html$ /index.php?main_page=product_reviews&products_id=$2&$args last;
  38.         rewrite ^/(.*)-pri-([0-9]+).html$ /index.php?main_page=product_reviews_info&products_id=$2&$args last;
  39.         rewrite ^/wishlist/$ /index.php?main_page=wishlist last;
  40.         rewrite ^/wishlist/(.*)$ /index.php?main_page=wishlist&letter=$1&$args last;
  41.         rewrite ^/wishlist/(.*)/([0-9]+).html$ /index.php?main_page=wishlist&letter=$1&page=$2&$args last;
  42.         rewrite ^/promotions/([0-9]+).html$ /index.php?main_page=promotions&page=$1&$args last;
  43.         rewrite ^/news/?$ /index.php?main_page=news&$args last;
  44.         rewrite ^/news/rss.xml$ /index.php?main_page=news_rss&$args last;
  45.         rewrite ^/news/archive/?$ /index.php?main_page=news_archive&$args last;
  46.         rewrite ^/news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ /index.php?main_page=news&date=$1-$2-$3&$args last;
  47.         rewrite ^/news/archive/([0-9]{4})-([0-9]{2}).html$ /index.php?main_page=news_archive&date=$1-$2&$args last;
  48.         rewrite ^/news/(.*)-a-([0-9]+)-comments.html$ /index.php?main_page=news_comments&article_id=$2&$args last;
  49.         rewrite ^/news/(.*)-a-([0-9]+).html$ /index.php?main_page=news_article&article_id=$2&$args last;
  50. if (!-f $request_filename){
  51.         set $rule_49 1$rule_49;
  52. }
  53. if (!-d $request_filename){
  54.         set $rule_49 2$rule_49;
  55. }
  56. if ($rule_49 = "21"){
  57.         rewrite ^/(.*).html$ /index.php?main_page=$1&$args last;
  58. }
复制代码
发表于 2013-10-10 21:34:33 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|宇宙主机交流论坛

GMT+8, 2024-11-1 12:29 , Processed in 0.078481 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表