是可以的,但你为什么要在“介绍”中询问这个问题呢?附加:你只需要创建一个index.php文件,将代码复制粘贴到文件中即可。 <?php$random = rand(1,3);if ($random == 1){ header('Location: http://www.example1.com/');}elseif ($random == 2){ header('Location: http://www.example2.com/');}else{ header('Location: http://www.example3.com/');}?>