メインページをDynamic Publishingにしてみました。
MTは記事を登録するときにHTMLを生成して、アクセスがあったときは既に作成されたページを返す、ってのが基本ですが、リクエスト時に動的にページを生成することもできます。それがDynamic Publishing。
仕組みは、対象となるディレクトリに、.htaccessを生成して全てのリクエストをmtview.phpに渡して、PHPで動的にページを生成させるみたい。
.htaccessのこの辺がキモ
RewriteEngine on
# don't serve mtview.php if the request is for a real directory
# (allows the DirectoryIndex lookup to function)
RewriteCond %{REQUEST_FILENAME} !-d
# don't serve mtview.php if the request is for a real file
# (allows the actual file to be served)
RewriteCond %{REQUEST_FILENAME} !-f
# anything else is handed to mtview.php for resolution
RewriteRule ^(.*)$ /~takech/blog/mtview.php [L,QSA]
で、メインページをDynamic Publishingにしてみたところ
SQL/DB Error -- [You have an error in your SQL syntax near 'select mt_entry.*, mt_placement.*, mt_author.*, mt_trackback.' at line 5]
というメッセージで、最近のコメント(MTComments)の部分が表示されなくなりました。
MySQLをデバッグしてみたりたところ、どうやらこのあたりのSQLがうまくいかなかったみたい。
061117 23:07:01 3 Query select mt_entry.*, mt_placement.*, mt_author.*,
mt_trackback.*
from mt_entry
left outer join mt_trackback on trackback_entry_id = entry_id
left outer join mt_placement on placement_entry_id = entry_id
and placement_is_primary = 1,
mt_author
where entry_status = 2
and entry_author_id = author_id
and entry_blog_id = 1
原因はMySQLのバージョンが3.23と古くて、left outer joinとかをサポートしてないらしい、ということなので、バージョンアップしてみました。
ビルドが面倒だったので、MySQL AB :: MySQL 4.1 DownloadsからRPMをダウンロードして、アップグレード。
mysqlユーザーが削除されるので、ユーザー作ってmysql再起動でおけー。
小粋空間: ダイナミックパブリッシング アーカイブ