我在Wordpress上製作一個重定向頁面。 PHP
將返回到網站主頁。但我無法取回主頁的網址。如何獲取主頁網址?
我的php文件路徑xampp\htdocs\wordpress\return.php
。
這裏是我的代碼:
$url = "$_SERVER[HTTP_HOST]";
header('Refresh: 3;url=' . $url);
echo get_option('home');
echo $url;
的$url
是localhost8080/wordpess/return.php
。 我想從url : localhost8080/wordpess/return.php
去url : local:8080/wordpress
。
如何取回網址local:8080/wordpress
?
THX
通過'localhost8080/wordpess/return.php',你真的指'localhost:8080/wordpress/return.php'嗎? – RRikesh