2009年7月アーカイブ

■robots.txtを使う

ディレクトリごとなど、複数のページを検索クロール禁止にするには、
ドキュメントルートにrobots.txtを置いて設定すると早い。


User-agent: *
Disallow: /internet/
Disallow: /av.html

■metaタグを使う

ドキュメントルートにrobots.txtをおけない場合や、
1ページだけ検索クロール禁止すればいいだけの時はmetaタグで禁止する。


<meta name="robots" content="noindex,nofollow" />

■リンク元から遮断する

クロールされてほしくないページに直接metaタグを書き込めない場合は、
そのページをリンクしているページに指定することができる。


<a href="http://hogehoge.com/" rel="nofollow">クロールされたくないリンク先</a>

■.htaccessで検索ボットのアクセスを遮断

上記方法でクロールを禁止にできるのは、google、yahoo、msnなど代表的な検索サイトで、
いくつかの検索サイトは上記方法をスルーしてしまう。(例えば、metaの方法はexciteには適応されないなど。)
そういうサイトもブロックするには、webサーバー(apache)の設定ファイル.htaccessで、検索ボットの出入りを禁止する。

# Google
SetEnvIf User-Agent "Googlebot" shutout
SetEnvIf User-Agent "Googlebot-Image" shutout
Deny from 66.249.64.0/19

■緊急に削除したい場合

googleの場合は、下記のURL 削除リクエスト ツールを使うと削除できます。
http://www.google.com/support/webmasters/bin/answer.py?answer=61062

mtで書き出す先のドメインと、本番サイトのドメインが違う時に便利

正規表現プラグインを入れる
http://www.sixapart.jp/movabletype/plugins/regex.html

テンプレートにドメインを取り除く正規表現を書く
<$MTAssetURL regex="s|http://www.xxxxx.jp||"$>

mt-static/plugins/FCKeditor/fckeditor/fckconfig.js

FCKConfig.TemplateReplaceAll = true ;

FCKConfig.TemplateReplaceAll = false ;
 

C:\Program Files\Apache Software Foundation\Apache2.2\conf の httpd.conf を編集(初回のみ)

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf
 

C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra の httpd-vhosts.conf を編集

<VirtualHost *:80>
    ServerAdmin info@kazy.jp
    DocumentRoot "C:/Documents and Settings/kajii/My Documents/web/kazy"
    ServerName kazy.w-07-012
    ServerAlias www.kazy.w-07-012
    ErrorLog "logs/kazy.localhost-error.log"
    CustomLog "logs/kazy.localhost-access.log" common
</VirtualHost>

<Directory "C:/Documents and Settings/kajii/My Documents/web/kazy"> 
    order deny,allow
    allow from ALL
    AllowOverride All
</Directory> 
 

C:\WINDOWS\system32\drivers\etc の hosts を編集

127.0.0.1       localhost
127.0.0.1       kazy.w-07-012