将特定页面重定向到另一个页面和域

我有一个网站脚本安装在服务器上并指向多个域。有时我需要将特定页面重定向到另一个站点,现在,我使用 Cloudflare 功能来重定向页面,但免费计划用户有限制。所以,我想知道如何使用 .htaccess、PHP 等重定向特定域上的特定页面?

例如,我/blablafirst.com和上有内容second.com,然后我想将页面重定向first.com/blablathird.com/target但不在 上second.com/blabla,两个域具有相同的 IP 并且内容在同一文件夹中。

谢谢


牧羊人nacy
浏览 95回答 2
2回答

慕田峪7331174

这应该对你有用。RewriteEngine onRewriteCond %{HTTP_HOST} ^(www\.)?first\.com$ [NC]RewriteRule ^/?blabla http://third.com/something [L,R]

开心每一天1111

在 php 中重定向:<?php&nbsp;header('Location:&nbsp;'.&nbsp;$newURL);&nbsp;?>在javascript中重定向:<script>window.location.href&nbsp;=&nbsp;"newurlhere";</script>
打开App,查看更多内容
随时随地看视频慕课网APP