RewriteCond RewriteRule

  ## Rules for TR and  ES country sites
  RewriteCond %{REQUEST_URI} ^/(tr|es)$ [NC]
  RewriteRule ^(.*)  https://xx.com [L,R=301]
  ##

  ## Rules for the old alias /sam/*
  RewriteRule ^pp/(.*)  /xx-p/$1 [L,R=301]
=== RewriteRule ^pp/(.*)  xx-p/$1 [L,R=301]{可行}

-------
可以看到的是,%{REQUEST_URI}是一个变量,且包含了前导/
RewriteRule恰好忽略前导/
--
还好有个工具

posted @ 2018-04-23 15:01  qqisnow2021  阅读(98)  评论(0编辑  收藏  举报