找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 54|回复: 6

大大们帮转个htaccess

[复制链接]

32

主题

113

回帖

340

积分

中级会员

积分
340
发表于 2011-4-14 16:25:37 | 显示全部楼层 |阅读模式
那个网上流传的apache转nginx工具不行
转出来的不能用


大神们谁会的帮转一下,谢谢[ol]
  • DirectoryIndex index.php
  • RewriteEngine On
  • RewriteRule ^page/(.*)$ index.php?cstart=$1 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$ engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4 [L]
  • RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$4&news_page=$2&cstart=$3 [L]
  • RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3&news_page=$2 [L]
  • RewriteRule ^([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$2&newsid=$3 [L]
  • RewriteRule ^([^.]+)/([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2 [L]
  • RewriteRule ^page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3&news_page=$1&cstart=$2 [L]
  • RewriteRule ^page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2&news_page=$1 [L]
  • RewriteRule ^print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$1&newsid=$2 [L]
  • RewriteRule ^([0-9]+)-(.*).html(/?)+$ index.php?newsid=$1 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2&day=$3 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&day=$3&cstart=$4 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&cstart=$3 [L]
  • RewriteRule ^([0-9]{4})(/?)+$ index.php?year=$1 [L]
  • RewriteRule ^([0-9]{4})/page/([0-9]+)(/?)+$ index.php?year=$1&cstart=$2 [L]
  • RewriteRule ^tags/([^/]*)(/?)+$ index.php?do=tags&tag=$1 [L]
  • RewriteRule ^tags/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=tags&tag=$1&cstart=$2 [L]
  • RewriteRule ^user/([^/]*)/rss.xml$ engine/rss.php?subaction=allnews&user=$1 [L]
  • RewriteRule ^user/([^/]*)(/?)+$ index.php?subaction=userinfo&user=$1 [L]
  • RewriteRule ^user/([^/]*)/page/([0-9]+)(/?)+$ index.php?subaction=userinfo&user=$1&cstart=$2 [L]
  • RewriteRule ^user/([^/]*)/news(/?)+$ index.php?subaction=allnews&user=$1 [L]
  • RewriteRule ^user/([^/]*)/news/page/([0-9]+)(/?)+$ index.php?subaction=allnews&user=$1&cstart=$2 [L]
  • RewriteRule ^user/([^/]*)/news/rss.xml(/?)+$ engine/rss.php?subaction=allnews&user=$1 [L]
  • RewriteRule ^lastnews/(/?)+$ index.php?do=lastnews [L]
  • RewriteRule ^lastnews/page/([0-9]+)(/?)+$ index.php?do=lastnews&cstart=$1 [L]
  • RewriteRule ^catalog/([^/]*)/rss.xml$ engine/rss.php?catalog=$1 [L]
  • RewriteRule ^catalog/([^/]*)(/?)+$ index.php?catalog=$1 [L]
  • RewriteRule ^catalog/([^/]*)/page/([0-9]+)(/?)+$ index.php?catalog=$1&cstart=$2 [L]
  • RewriteRule ^newposts(/?)+$ index.php?subaction=newposts [L]
  • RewriteRule ^newposts/page/([0-9]+)(/?)+$ index.php?subaction=newposts&cstart=$1 [L]
  • RewriteRule ^static/(.*).html(/?)+$ index.php?do=static&page=$1 [L]
  • RewriteRule ^favorites(/?)+$ index.php?do=favorites [L]
  • RewriteRule ^favorites/page/([0-9]+)(/?)+$ index.php?do=favorites&cstart=$1 [L]
  • RewriteRule ^rules.html$ index.php?do=rules [L]
  • RewriteRule ^statistics.html$ index.php?do=stats [L]
  • RewriteRule ^addnews.html$ index.php?do=addnews [L]
  • RewriteRule ^rss.xml$ engine/rss.php [L]
  • RewriteRule ^sitemap.xml$ uploads/sitemap.xml [L]
  • RewriteCond %{REQUEST_FILENAME} !-d
  • RewriteRule ^([^.]+)/page/([0-9]+)(/?)+$ index.php?do=cat&category=$1&cstart=$2 [L]
  • RewriteRule ^([^.]+)/?$ index.php?do=cat&category=$1 [L]
  • RewriteCond %{REQUEST_FILENAME} !-f
  • RewriteRule ^([^.]+)/rss.xml$ engine/rss.php?do=cat&category=$1 [L]
  • RewriteRule ^page,([0-9]+),([^/]+).html$ index.php?do=static&page=$2&news_page=$1 [L]
  • RewriteRule ^print:([^/]+).html$ engine/print.php?do=static&page=$1 [L]
  • RewriteCond %{REQUEST_FILENAME} !-f
  • RewriteRule ^([^/]+).html$ index.php?do=static&page=$1 [L][/ol]复制代码
  • 回复

    使用道具 举报

    91

    主题

    2700

    回帖

    5729

    积分

    论坛元老

    积分
    5729
    发表于 2011-4-14 16:35:52 | 显示全部楼层
    rewrite ^/page/(.*)$ /index.php?cstart=$1 last;
            rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$ /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6 last;
            rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$ /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 last;
            rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$ /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 last;
            rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$ /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4 last;
            rewrite ^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$4&news_page=$2&cstart=$3 last;
            rewrite ^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$3&news_page=$2 last;
            rewrite ^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ /engine/print.php?news_page=$2&newsid=$3 last;
            rewrite ^/([^.]+)/([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$2 last;
            rewrite ^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$3&news_page=$1&cstart=$2 last;
            rewrite ^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$2&news_page=$1 last;
            rewrite ^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ /engine/print.php?news_page=$1&newsid=$2 last;
            rewrite ^/([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$1 last;
            rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$ /index.php?year=$1&month=$2&day=$3 last;
            rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$ /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
            rewrite ^/([0-9]{4})/([0-9]{2})(/?)+$ /index.php?year=$1&month=$2 last;
            rewrite ^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$ /index.php?year=$1&month=$2&cstart=$3 last;
            rewrite ^/([0-9]{4})(/?)+$ /index.php?year=$1 last;
            rewrite ^/([0-9]{4})/page/([0-9]+)(/?)+$ /index.php?year=$1&cstart=$2 last;
            rewrite ^/tags/([^/]*)(/?)+$ /index.php?do=tags&tag=$1 last;
            rewrite ^/tags/([^/]*)/page/([0-9]+)(/?)+$ /index.php?do=tags&tag=$1&cstart=$2 last;
            rewrite ^/user/([^/]*)/rss.xml$ /engine/rss.php?subaction=allnews&user=$1 last;
            rewrite ^/user/([^/]*)(/?)+$ /index.php?subaction=userinfo&user=$1 last;
            rewrite ^/user/([^/]*)/page/([0-9]+)(/?)+$ /index.php?subaction=userinfo&user=$1&cstart=$2 last;
            rewrite ^/user/([^/]*)/news(/?)+$ /index.php?subaction=allnews&user=$1 last;
            rewrite ^/user/([^/]*)/news/page/([0-9]+)(/?)+$ /index.php?subaction=allnews&user=$1&cstart=$2 last;
            rewrite ^/user/([^/]*)/news/rss.xml(/?)+$ /engine/rss.php?subaction=allnews&user=$1 last;
            rewrite ^/lastnews/(/?)+$ /index.php?do=lastnews last;
            rewrite ^/lastnews/page/([0-9]+)(/?)+$ /index.php?do=lastnews&cstart=$1 last;
            rewrite ^/catalog/([^/]*)/rss.xml$ /engine/rss.php?catalog=$1 last;
            rewrite ^/catalog/([^/]*)(/?)+$ /index.php?catalog=$1 last;
            rewrite ^/catalog/([^/]*)/page/([0-9]+)(/?)+$ /index.php?catalog=$1&cstart=$2 last;
            rewrite ^/newposts(/?)+$ /index.php?subaction=newposts last;
            rewrite ^/newposts/page/([0-9]+)(/?)+$ /index.php?subaction=newposts&cstart=$1 last;
            rewrite ^/static/(.*).html(/?)+$ /index.php?do=static&page=$1 last;
            rewrite ^/favorites(/?)+$ /index.php?do=favorites last;
            rewrite ^/favorites/page/([0-9]+)(/?)+$ /index.php?do=favorites&cstart=$1 last;
            rewrite ^/rules.html$ /index.php?do=rules last;
            rewrite ^/statistics.html$ /index.php?do=stats last;
            rewrite ^/addnews.html$ /index.php?do=addnews last;
            rewrite ^/rss.xml$ /engine/rss.php last;
            rewrite ^/sitemap.xml$ /uploads/sitemap.xml last;
    if (!-d $request_filename){
            set $rule_42 1$rule_42;
    }
    if ($rule_42 = "1"){
            rewrite ^/([^.]+)/page/([0-9]+)(/?)+$ /index.php?do=cat&category=$1&cstart=$2 last;
    }
            rewrite ^/([^.]+)/?$ /index.php?do=cat&category=$1 last;
    if (!-f $request_filename){
            set $rule_44 1$rule_44;
    }
    if ($rule_44 = "1"){
            rewrite ^/([^.]+)/rss.xml$ /engine/rss.php?do=cat&category=$1 last;
    }
            rewrite ^/page,([0-9]+),([^/]+).html$ /index.php?do=static&page=$2&news_page=$1 last;
            rewrite ^/print

    [^/]+).html$ /engine/print.php?do=static&page=$1 last;
    if (!-f $request_filename){
            set $rule_47 1$rule_47;
    }
    if ($rule_47 = "1"){
            rewrite ^/([^/]+).html$ /index.php?do=static&page=$1 last;
    }



    应该可以用呀
    回复

    使用道具 举报

    34

    主题

    555

    回帖

    1254

    积分

    金牌会员

    积分
    1254
    发表于 2011-4-14 16:42:18 | 显示全部楼层
    回复

    使用道具 举报

    212

    主题

    1278

    回帖

    3214

    积分

    论坛元老

    积分
    3214
    发表于 2011-4-14 16:49:52 | 显示全部楼层
    好复杂啊你这个
    回复

    使用道具 举报

    32

    主题

    113

    回帖

    340

    积分

    中级会员

    积分
    340
     楼主| 发表于 2011-4-14 16:50:51 | 显示全部楼层
    原帖由 mikj521 于 2011-4-14 16:35 发表


    rewrite ^/page/(.*)$ /index.php?cstart=$1 last;
            rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$ /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cs ...


    不行呢,只显示首页,不管打开什么地址,都是显示首页
    回复

    使用道具 举报

    4

    主题

    142

    回帖

    302

    积分

    中级会员

    积分
    302
    发表于 2011-4-14 16:50:54 | 显示全部楼层
    原帖由 yaren 于 2011-4-14 16:42 发表


    给你个我一直在用的:
    http://www.anilcetin.com/convert-apache-htaccess-to-nginx/

    我就是用这个转的,不能用,只显示首页
    回复

    使用道具 举报

    32

    主题

    113

    回帖

    340

    积分

    中级会员

    积分
    340
     楼主| 发表于 2011-4-14 16:51:33 | 显示全部楼层
    这么复杂的东西,人都不好处理,自动转肯定不行
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|Discuz! X

    GMT+8, 2025-1-12 01:52 , Processed in 0.022338 second(s), 5 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

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