Web担当者さんへ 今回は技術的な説明が多く、実際に設定ファイルを操作できない場合もあるかと思います。リダイレクト関連の設定は一歩間違えると致命傷です。場合によっては、対策が必要かどうかの検討が必要になるでしょう。動的URL、静的URLとは何かURLには大きく分けて、動的URLと静的URLの2種類があります。 動的URL(ダイナミックURL)の例: http://www.example.com/dir1/file.html?query1=param1静的URL(スタティックURL)の例: http://www.example.com/dir1/file/query1/param1/その違いは、URL中に「?」「=」「&」などのパラメータが含まれているかどうかです。 SEOの世界では、コンテンツが動的に生成されるケース、つまり特定の条件に対するページが単一のHTMLファイルで用意されておらず
パラメータ入りのURLを人にもクローラにもわかりやすいURLに変換することの利点は、みんなすでに理解していることだろう。でも、カテゴリや製品ページの数が膨大にある場合、標準的なURLリライトツール(ISAPI_Rewrite、mod_rewriteなど)では、必ずしもそれほどうまく対応できるというわけではない。そこで今回は、このコードを自分で書くには何が必要かを順を追って説明して、みんなが思っているほど恐ろしくも複雑ではないことをわかってもらい、その後のメンテナンスや柔軟性などについての利点もいくつか示すつもりだ。 概要出発点君のサイトではパラメータが含まれたURLを使用しているが、SEOおよびユーザーの使い勝手という観点からは、ある程度読みやすいURLのほうが有利ではないかと考えている。サイトにはたくさんのコンテンツがある。その多くはデータベースから引き出してきたものだ。製品、カテゴリ、
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html を見ながら。 URLが正規表現(A)にマッチし、かつ 文字列(B)が条件(C)を満たす場合に、 URLを(D)に書き換える。 というのが基本。 RewriteRule URLが(A)の正規表現にマッチしたら(D)で書き換える。 正規表現(A)は、リライトを実行するかどうかの条件(真偽値)であって、置換 url =~ s/(A)/(D)/ ということではない。たとえば、以下のような正規表現でリライトされる。 Google Code Search # 1文字マッチしたらリライト実行。空文字列でなければ実行する。 RewriteRule . index.php [L] Google Code Search # 先頭にマッチしたらリライト実行。常に実行する。 RewriteRule ^ -
HTMList.com 日本でもSEOの認識が高まり、検索エンジンに対してより有効なコンテンツの作成方法やURLの作成方法が議論されるようになってきた。ここではURLの側面からHTMList.comに掲載されているA Simple mod_rewrite Tutorial: SEO-Friendly, Attractive URLsを紹介したい。これはApacheのmod_rewriteモジュールを使ってより読みやすくて魅力的なURLを実現しようというものだ。 A Simple mod_rewrite Tutorial: SEO-Friendly, Attractive URLsはひとつのURLを例に上げながら、最終的にどういったURLに変換するかを含めてmod_rewriteの有効化方法や変換規則の記述方法を説明している。最近ではブログが発達したため自分でWebサーバを構築する機会は少な
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く