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恰好忽略前导/
--
还好有个工具

猜你喜欢

转载自www.cnblogs.com/qinqiu/p/8919184.html