只允许包含参数的url


allow only urls that have a parameter in

所以,我有一个重定向到另一个做Double Meta Refresh (cleans referer)url,我想只允许在url comes with a parameter时看到second url

当前设置为:

urlA.php  --DMR--->  urlB.php

我希望用户能够看到urlB only if they come from urlA,但由于referrer在中间被清理,我认为我不能通过referrer在.htacces中检查。

所以我在考虑检查一个参数,所以urlB只有在一个特殊的参数出现时才能访问,比如:

urlA.php  ----DMR--->  urlB.php   ///NOT POSSIBLE
urlA.php?key=xxxx  ----DMR--->  urlB.php   /// POSSIBLE

提前感谢。

当然,如果你传递一个GET参数,你可以使用:

<?php 
if(!isset($_GET["key"]) || $_GET["key"] !== "urlA.php"){
   die("you must come from a certain page" );
}else{
  echo "You came from the right place";
}