需要进行从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>
在两种方式中,我都有循环页面刷新的结果。
如何正确解决这个问题?
试试这里的解决方案:http://stackoverflow.com/a/506004/889678 – mgraph
谢谢。它按我的意愿工作。 – v2p