我正在尝试为我的网站使用网址重写,该网站可以包含以下URI:
- http://localhost:8888/category.php?c=31&ctitle=entreprise
- http://localhost:8888/subcategory.php?s=96&title=service
对于我使用的第一个
RewriteRule ^([^/]*)/([^/]*)\.html$ /category.php?c=$1&ctitle=$2 [L]
第二个是
RewriteRule ^([^/]*)/([^/]*)\.html$ /subcategory.php?s=$1&title=$2 [L]
每个重写规则都是正确的,但第二个不适用。 如果我只使用第二条规则,那就可以了。
这是我的完整htaccess
Options +FollowSymlinks
RewriteEngine On
### REWRITE URLS
RewriteRule ^([^/]*)/([^/]*)\.html$ /category.php?c=$1&ctitle=$2 [L]
RewriteRule ^([^/]*)/([^/]*)\.html$ /subcategory.php?s=$1&title=$2 [L]
有什么想法吗? THX
答案 0 :(得分:0)
两种模式相同,因此应用第一条规则。 将第二种模式更改为不同的模式,然后也将应用它。