希望你没事。
如果你能帮助我,我有一个问题。
(WORKING:)
RewriteRule ^artists\/(.*[^discographies])\,([0-9]*)\/$ /artists/artist.php?id=$2 [L]
网址: / artists / B / barrington-levy,869 /
(工作:)
RewriteRule ^artists\/(.*[^discographies])\,([0-9]*)\/discography\/$ /artists/discography.php?id=$2 [L,QSA]
网址: / artists / B / barrington-levy,869 / discography /
(WORKING:)
RewriteRule ^artists\/(.*[^discographies])\/$ /artists/alpha.php?id=$1 [L]
网址: / artists / B /
现在我需要制定一些新规则,我很糟糕!
第一个: /艺术家/唱片分类目录/ 1979 /巴灵顿-征少林寺,85 /
(不工作:)
RewriteRule ^artists\/discographies\/([0-9]*)\/(.*)\,[(0-9)*]\/$ /artists/disc.php?id=$4 [L]
第二个: /艺术家/唱片分类目录/ 2009-10 /各种-艺术家,扎哈-沙卡-呈现最积极的消息,2563 /
(不工作:)
RewriteRule ^artists\/discographies\/([0-9]*)\-([0-9]*)\/(.*)\,[(0-9)*]\/$ /artists/disc.php?id=$4 [L]
答案 0 :(得分:1)
而不是[(0-9)*]
尝试([0-9]*)
因此对于整个规则替换:
RewriteRule ^artists\/discographies\/([0-9]*)\/(.*)\,[(0-9)*]\/$ /artists/disc.php?id=$4 [L]
RewriteRule ^artists\/discographies\/([0-9]*)\-([0-9]*)\/(.*)\,[(0-9)*]\/$ /artists/disc.php?id=$4 [L]
使用:
RewriteRule ^artists\/discographies\/([0-9]*)\/(.*)\,([0-9]*)\/$ /artists/disc.php?id=$3 [L]
RewriteRule ^artists\/discographies\/([0-9]*)\-([0-9]*)\/(.*)\,([0-9]*)\/$ /artists/disc.php?id=$3 [L]