말러 83님의 팁을 쬐끔 수정한 겁니다.
google, ms, yahoo는 지원하는데, 네이버의 지원여부는 모르겠습니다.
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=20826아래 코드를 </head> 앞에 넣어줍니다.
if(stristr($_SERVER[PHP_SELF], "/bbs/board.php") == true && $bo_table) {
if ($wr_id)
echo "<link rel=\"canonical\" href=\"$_SERVER[PHP_SELF]?bo_table=$bo_table&wr_id=$wr_id\" />";
else
echo "<link rel=\"canonical\" href=\"$_SERVER[PHP_SELF]?bo_table=$bo_table\" />";
}
참조자료
풀 URL을 안쓰는 이유
Can I use a relative path to specify the canonical, such as <link rel="canonical" href="product.php?item=swedish-fish" />?
Yes, relative paths are recognized as expected with the <link> tag. Also, if you include a<base> link in your document, relative paths will resolve according to the base URL.
Yes, relative paths are recognized as expected with the <link> tag. Also, if you include a<base> link in your document, relative paths will resolve according to the base URL.
- opencode.co.kr -