加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

NGINX / Apache RewriteMap

发布时间:2020-12-13 20:57:59 所属栏目:Nginx 来源:网络整理
导读:我想知道如何在NGINX中翻译Apache“ RewriteMap”指令. 我在NGINX在线文档中什么都没找到 我当前的apache代码是: RewriteMap map-one txt:C:/map-one.txtRewriteMap map-two txt:C:/map-two.txtDirectory / Options All AllowOverride All RewriteEngine On

我想知道如何在NGINX中翻译Apache“ RewriteMap”指令.

我在NGINX在线文档中什么都没找到

我当前的apache代码是:

RewriteMap map-one txt:C:/map-one.txt
RewriteMap map-two txt:C:/map-two.txt

<Directory /> 
    Options All 
    AllowOverride All
    RewriteEngine On
    RewriteRule /MYSITE/PRODUCT/([A-Za-z0-9-]+)/([A-Za-z0-9-]+),([0-9]+).aspx /$1/$2/${map-two:$3}/${map-one:$3} [R=301,L]
</Directory> 

任何想法 ?

最佳答案
检查Nginx HTTP Map Module

map $uri $new {
  default               http://www.domain.com/home/;

  /aa                   http://aa.domain.com/;
  /bb                   http://bb.domain.com/;
  /john                 http://my.domain.com/users/john/;
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读