-1
header("Location: https:/index.php");
頁面重定向到index.php
頁面,但它重定向使用https://website.com
,我需要保持www.website.com
。PHP頭重定向加www
如何使用相對路徑保持www重定向?
header("Location: https:/index.php");
頁面重定向到index.php
頁面,但它重定向使用https://website.com
,我需要保持www.website.com
。PHP頭重定向加www
如何使用相對路徑保持www重定向?
你試過..('location:http://www.website.com')?
您可以使用$ _ SERVER [「HTTP_HOST」]擷取您的服務器,這樣的主機名:
$hostname = $_SERVER['HTTP_HOST'] ;
header("Location: {$hostname}".);
是的,但我的設置會話不留重定向到索引頁面是動態的。 –