[英]How to redirect a php page with different
我沒有太多的編程知識,所以我需要幫助。 我想將301 /url/viewforum.php?f=19重定向到另一個頁面。 因此,要放入viewform.php中。 我使用以下代碼
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/");
exit();
?>
但是它重定向了/viewform.php中的所有內容,但我只想重定向/viewform.php?f=19
<?php
if($_GET['f']==19)
{
//header("HTTP/1.1 301 Moved Permanently"); no need
header("Location: http://www.example.com/");
exit();
}
?>
希望對你有幫助
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.