0

我重新设计了我的网站和链接的结构方式,它们过去的结构是这样的

www.domain.com/firstvariable/secondvariable

现在他们就像

www.domain.com/cat/firstvariable_secondvariable.html

我可以有一个规则,将 / 之后的所有内容重定向到 /mp3/,但是我已经必须从实际的 mp3.php 重定向到 /mp3 的规则通过使用 / 规则被覆盖

它还会影响我的其他具有 1 个“分隔符”和 2 个变量的页面,我该如何阻止它?

.htaccess

RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
RewriteRule ^mp3/(.*)-(.*)/?.html$ mp3.php?artist=$1&song=$2 [nc]
RewriteRule ^(.*)/(.*)$ /mp3/$1_$2.html [R=301,L]
4

0 回答 0