.htaccess 重定向来自Youtube的传入转介链接
来自YouTube视频的用户已链接到我的WordPress主页。 但是,我希望传入的流量转到另一个页面 我尝试了.htaccess:.htaccess 重定向来自Youtube的传入转介链接,.htaccess,.htaccess,来自YouTube视频的用户已链接到我的WordPress主页。 但是,我希望传入的流量转到另一个页面 我尝试了.htaccess: Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_REFERER} http\://www\.youtube\.com/watch\?v\=xxxxxxxxxx [NC] RewriteCond %{REQUEST_URI} !^/index\.php$ RewriteRule ^(.*)$
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} http\://www\.youtube\.com/watch\?v\=xxxxxxxxxx [NC]
RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteRule ^(.*)$ http://www.domain.com/abc/post/ [R=302,L]
我100%相信代码是正确的,但它不起作用。除了上述代码之外,还有其他选择吗?也许我可以在头文件或索引文件中使用PHP?首先,youtube链接通常是https,因此您应该添加一个检查:
RewriteCond %{HTTP_REFERER} https?\://www\.youtube\.com/watch\?v\=xxxxxxxxxx [NC]
另一件事是在视频结束前需要一个空格和[NC]
标志