【问题标题】:Rewrite cond in .htaccess.htaccess 中的重写条件
【发布时间】:2011-11-26 00:43:45
【问题描述】:
RewriteRule ^Therapists/(.*/([a-zA-Z0-9_-]+)|([a-zA-Z0-9_-]+))$ Therapist/city.php?value1=$1 
  • 如何为美国创建模式
  • abcdef-abcdef - 之前的 6 个字符和 - 之后的 6 个字符

【问题讨论】:

    标签: .htaccess


    【解决方案1】:

    如果您想要在 - 之前和使用 {6} 之后恰好有 6 个字符,如果您想要 1-6 个字符,请使用 {1,6}。一般来说,对于最小到最大字符,请修改以下规则以使用{min, max}

    RewriteRule ^Therapists/(.*/([a-zA-Z0-9_]{6})-([a-zA-Z0-9_]{6}))$ Therapist/city.php?value1=$1 
    

    RewriteRule ^Therapists/(.*/([a-zA-Z0-9_]{1,6})-([a-zA-Z0-9_]{1,6}))$ Therapist/city.php?value1=$1 
    

    等等

    【讨论】:

      猜你喜欢
      • 2011-04-03
      • 1970-01-01
      • 1970-01-01
      • 2016-12-14
      • 2019-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多