我如何根据htaccess重定向包含特定单词的所有网址
例如:
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}
答案 0 :(得分:0)
您可以在.htaccess
:
RewriteEngine on
RewriteRule its-showtime http://showtime.com.ph [NC,R=301,L]