1원 팁 긴주소 줄이기 (Rewrite 방식아님)
1원 팁 긴주소 줄이기 (Rewrite 방식아님)
http://freeimage.kr/bbs/board.php?bo_table=tip_gnu&wr_id=453 를
http://freeimage.kr/bbs/?tip_gnu=453 로 줄임.
http://freeimage.kr/bbs/board.php?bo_table=tip_gnu 는
http://freeimage.kr/bbs/?tip_gnu 로 됨..
/bbs/index.php 에 다음 문장을 넣으면됩니다.
<?
if (!$bo_table && preg_match("/(.[a-zA-Z0-9_]+)=([0-9]+)/", urldecode($_SERVER[QUERY_STRING]), $arr)) {
$_GET[bo_table]=$arr[1];
$_GET[wr_id]=$arr[2];
}
else if (!$bo_table && preg_match("/^[a-zA-Z0-9_]+\$/", urldecode($_SERVER[QUERY_STRING]), $arr)) {
$_GET[bo_table]=$arr[0];
}
include "board.php";
?>
http://freeimage.kr/bbs/board.php?bo_table=tip_gnu&wr_id=453 를
http://freeimage.kr/bbs/?tip_gnu=453 로 줄임.
http://freeimage.kr/bbs/board.php?bo_table=tip_gnu 는
http://freeimage.kr/bbs/?tip_gnu 로 됨..
/bbs/index.php 에 다음 문장을 넣으면됩니다.
<?
if (!$bo_table && preg_match("/(.[a-zA-Z0-9_]+)=([0-9]+)/", urldecode($_SERVER[QUERY_STRING]), $arr)) {
$_GET[bo_table]=$arr[1];
$_GET[wr_id]=$arr[2];
}
else if (!$bo_table && preg_match("/^[a-zA-Z0-9_]+\$/", urldecode($_SERVER[QUERY_STRING]), $arr)) {
$_GET[bo_table]=$arr[0];
}
include "board.php";
?>
첨부파일
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 10개
좋은정보 감사합니다~~~~
아주 잘 되네요...
index.php만 만들어 넣었다고 그냥 되는게 아니라,
해당 게시물의 링크를 짧은 주소로 걸어서 사용해야 합니다.