Canonical URL setup with a fix to the original article. Absorbed all netj.org stuffs into Git. Enclosed <xi:include>s with <div> to avoid errors. Embedded older comments. Removed RCS archives, annotated logs in headers. Translated to Markdown Location으로 안되는 경우가 있어서 고침

Apache의 mod_rewrite을 이용하여 대표 URL로 보내는 방법. 설정 파일의 해당 전역 또는 VirtualHost에 해당하는 부분에 다음과 같은 내용을 추가하고 DocumentRoot와 netj.org를 적절히 바꾸면 된다:

DocumentRoot /home/netj/netj.org/www/

# Canonical Domain Name
<Directory /home/netj/netj.org/www/>
    RewriteEngine on
    RewriteCond %{HTTP_HOST}    !^[0-9]+(\.[0-9]+){3}$
    RewriteCond %{HTTP_HOST}    !^\[[0-9a-fA-F:]+\]$
    RewriteCond %{HTTP_HOST}    !^netj.org  [NC]
    RewriteCond %{HTTP_HOST}    !^$
    RewriteCond %{SERVER_PORT}  ^80$
    RewriteRule .*              http://netj.org%{REQUEST_URI}  [L,R]
</Directory>

hacking