【发布时间】:2016-03-23 08:15:03
【问题描述】:
如何通过 htaccess 重定向所有包含特定单词的 URL
例如:
http://videos.showtime.com.ph/its-showtime-hashtag-boys-macho-dance_03be98da6.html
应该被重定向到:
http://showtime.com.ph
具体的词应该是its-showtime。应重定向所有 its-showtime 所在的 URls。
我已经尝试了一些方法,但不起作用。
更新:现有 .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}
【问题讨论】:
标签: php apache .htaccess mod-rewrite redirect