开发者社区 问答 正文

一个nginx rewrite 配置问题 :报错

想把 www.xxx.com/index.php?xxxxxxxxxx重定向到  www.xxx.com/other.php?xxxxxxxxxx,这个怎么弄

展开
收起
kun坤 2020-06-14 16:01:39 591 分享 版权
1 条回答
写回答
取消 提交回答
  • location index.php {
        access_log off;

        rewrite (.*) http://www.xxx.com/other.php$1 permanent;

    }
    ######回复 @红薯 : 还是无限重定向######回复 @simaguo : 那个 $1 去掉先把######试了下不行耶,两个xxx是同一域名,会无限重定向下去
    2020-06-14 16:01:46
    赞同 展开评论