如何在 URL 中重定向多个 bad/adults 关键字?
我试图用 htaccess 来做,但我认为这对很多关键字都没有好处
例子:
http://example.com/mp3/sex-with-me/page/1 重定向到 http://example.com/mp3/with-me/page/1
http://example.com/video/selena-gomes-porn/page/1 重定向到 http://example.com/video/selena-gomes/page/1
htaccess 文件中的一些代码:
RewriteRule ^mp3/(.*)-sex/page/(.*)?$ http://site.com/mp3/$1/page/$2 [R=301,L]
RewriteRule ^mp3/(.*)-sex-(.*)/page/(.*)?$ http://site.com/mp3/$1-$2/page/$3 [R=301,L]
RewriteRule ^mp3/sex-(.*)/page/(.*)?$ http://site.com/mp3/$1/page/$2 [R=301,L]
RewriteRule ^video/(.*)-porn/page/(.*)?$ http://site.com/video/$1/page/$2 [R=301,L]
RewriteRule ^video/(.*)-porn-(.*)/page/(.*)?$ http://site.com/video/$1-$2/page/$3 [R=301,L]
RewriteRule ^video/porn-(.*)/page/(.*)?$ http://site.com/video/$1/page/$2 [R=301,L]
可以用 PHP 做到这一点吗?