Friendly URL (mod-rewrite) issue

后端 未结 1 1123
忘掉有多难
忘掉有多难 2021-01-16 17:20

Hallo,

I am trying to make \"nice\" URL, first rule works as expected, it\'s turning

www.blabla.com/index.php?page=tags&tag=blabla

into

相关标签:
1条回答
  • 2021-01-16 17:54

    Since numbers could be considered as anything but a forward slash (/), you should put the article rule before the tag rule:

    RewriteEngine On
    RewriteRule ^([^/]*)/([0-9]*)$ /index.php?page=$1&article=$2 [L]
    RewriteRule ^([^/]*)/([^/]*)$ /index.php?page=$1&tag=$2 [L]
    
    0 讨论(0)
提交回复
热议问题