검색엔진최적화 – 검색엔진 친화적인 리디렉션(redirection) 체크와 방법
리디렉션(redirection) 또는 리디렉트(redirect)는 여러가지 이유로 사용하여 원하는 페이지로 연결하는 기능을 하지만 잘못 사용하였을 때는 검색엔진최적화에 있어서 좋지 않은 결과로 이어질 수 있다.
또한 잘만 사용한다면 검색엔진에 잘 등록된 기존의 url이나 웹페이지를 PageRank나 백링크(backlinks)의 손실(?)없이 새로운 url이나 웹페이지로 연결시킬 수도 있다.
리디렉션의 검색엔진최적화, 검색엔진 친밀도 체크하기
검색엔진 고려한 리디렉션(redirection) 방법에 대해 아래에 정리하였다.
검색엔진최적화를 고려한 301 리디렉션 방법들
301 리디렉션 html
.htaccess 파일이 이용한다. .htaccess파일은 기존 웹사이트 루트 디렉토리에 삽입하면 된다.
option 1. Redirect 301 / http://www.new-url.com/this_is_my/long_url.html
option 2. RewriteCond %{HTTP_HOST} ^new-url\.com [NC]
RewriteRule ^(.*) http://www.yourdomain.com/$1 [R=301,L]
The code below should be added at the top of the page.
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: http://www.new-url.com”);
exit();
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”, “http://www.new-url.com”
response.end
%>
function PermanentRedirect(strDestinationUri) {
Response.Clear();
Response.Status = 301;
Response.AddHeader(“Location”, strDestinationUri);
Response.Flush();
Response.End();
}
“strDestinationUri” 은 절대 경로이어야 함.
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(“Location”,”http://www.new-url.com”);
}
</script>
301 리디렉션 JSP / JAVA
<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.new-url.com” );
response.setHeader( “Connection”, “close” );
%>
그 밖의 리디렉션 방법들(클라이언트 차원의 방법들)
<META HTTP-EQUIV=Refresh CONTENT=”0; URL=http://www.new-url.com”>
검색엔진최적화 관점에서 논란이 있는 리디렉션 방법으로 SEO전문가들도 서로 다른 견해를 가지고 있으므로 그렇게 추천할 만한 방법은 아닌 것 같다.
자바스크립트 리디렉션 ( 비추천 !! )
Option 1
<script type=”text/javascript”>
<!–
window.location = “http://www.new-url.com/”
//–>
</script>
Option 2
<body onLoad=”setTimeout(location.href=’http://www.new-url.com’, ‘0’)” >
대부분의 검색엔진은 자바스크립트를 인식하지 못하거나 무시하기 때문에 검색엔진에게는 좋지 않는 방법으로 검색엔진최적화를 생각한다면 추천하지 않고 싶은 리디렉션 방법 중에 하나다.