MovableTypeでPHPを動かしたいのだけど、拡張子を変更すると、URLが変わってしまうので困る。 どうすればよいか?という質問を受けたので、他にも同じことを知りたがっている人もいるかと思ってブログに書いておきます。 この場合、単純にサーバに対して、htmlの拡張子のものはphpで動作するよう命令をするだけです。 .htaccessに次のように記述してアップしましょう。 AddType application/x-httpd-php .html これで、.html のファイルが phpのファイルとして解釈されるはずです。 注意).htaccessが対応していないサーバ等では使えません これによって、MTのテンプレート内でphpが書けるのでアクセス解析を仕込んだり、カウンタを仕込んだりと、いろいろ出来ます。
16 Useful .htaccess Tricks and Hacks For Web Developers : Online Marketing Blog - Website Development & Website Marketing tips and Strategies .htaccessで使える16の技が色々と紹介されていました。 1. ErrorDocumentでエラーページ指定の方法 ErrorDocument 401 /error/401.php ErrorDocument 403 /error/403.php ErrorDocument 404 /error/404.php ErrorDocument 500 /error/500.php 2. Timezone設定 SetEnv TZ America/Houston 3. IPブロッキング allow from al
onPHP5.comで、非常に見落としやすいSEOのTipsが掲載されています。http://www.example.com/ というサイトに http://example.com/ でも繋がるようであれば、これは重複するURLであるといえます。このような重複するURLがあると、同じページへのリクエストが複数に分散されてしまうためSEO的に不利になるということです。この記事ではこれらをmod_rewriteとPHPスクリプトを用いて防ぐ方法が紹介されています。 onPHP5.comで、非常に見落としやすいSEOのTipsが掲載されています。これは、重複するURLを無くすことに重点が置かれたSEO対策です。 たとえば、http://www.example.com/ というサイトに http://example.com/ でも繋がるようであれば、これは重複するURLであるといえます。このような
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く