【发布时间】:2012-08-26 06:59:15
【问题描述】:
需要将http://sitename.com/cat/index.php重定向到http://sitename.com/cat/index.php#anchor
我尝试了 2 种方法:php 重定向和元刷新
PHP 重定向
<?php
$URL = "http://sitename.com/cat/index.php#anchor";
header("Location: $URL");
?>
<html>
....
元刷新
<html>
<head>
...
<meta http-equiv="refresh" content="0;url=http://sitename.ru/cat/index.php#anchor">
...
</head>
...
</html>
结果我有循环页面刷新。
如何正确解决这个问题?
【问题讨论】:
-
在这里尝试解决方案:stackoverflow.com/a/506004/889678
-
谢谢。它可以按我的意愿工作。