【问题标题】:Why is this Rewrite rule in my .htaccess file on Apache causing a 500 Internal Error?为什么我在 Apache 上的 .htaccess 文件中的重写规则会导致 500 内部错误?
【发布时间】:2013-12-18 14:48:25
【问题描述】:

这是导致 500 错误的规则。当我删除它时,我的网站运行正常。想法?

RewriteRule ^pin/([^]+)/ pin.php?id=$1 [L]

【问题讨论】:

    标签: regex apache .htaccess mod-rewrite url-rewriting


    【解决方案1】:

    [^]+ 此处的正则表达式不正确。试试这个规则:

    RewriteEngine On
    
    RewriteRule ^pin/([^/]+)/?$ /pin.php?id=$1 [L,QSA,NC]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-31
      • 1970-01-01
      • 2014-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多