如果包含单词,则URL重定向


URL redirect if contains a word

如何重定向每个htaccess包含特定单词的所有URL

例如:

http://videos.showtime.com.ph/its-showtime-hashtag-boys-macho-dance_03be98da6.html

应重定向到:

http://showtime.com.ph

具体的单词应该是its-showtime。应重定向its-showtime所在的所有URL。

我已经试过了,但不起作用。

更新:现有.htaccess文件:

RewriteCond %{HTTP_HOST} ^([^.]+)'.showtime'.com'.ph$ [NC]
RewriteRule ^(.*)$ showtime'.com'.ph/$1 [L,R=301,NC]
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}

已解决:https://webmasters.stackexchange.com/questions/88435/how-to-redirect-url-with-specific-characters/88440?noredirect=1#comment108357_88440

您可以在.htaccess:中使用它

RewriteEngine on
RewriteRule its-showtime http://showtime.com.ph [NC,R=301,L]