‘apache’ カテゴリーのアーカイブ

Rewriteで引数

2008 年 7 月 6 日 日曜日

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9A-Za-z]+)/([0-9A-Za-z)]+)\.html$ index.php?var1=$1&var2=$2 [L]

【index.php】

<?php
print_r($_REQUEST);
?>

RewriteでPHPからHTML

2008 年 7 月 6 日 日曜日

RewriteEngine on
RewriteRule    ^$    /index.php    [L]
RewriteRule    ^([a-zA-Z0-9\-\_/]*)/$    /$1/index.php    [L]
RewriteRule    ^([a-zA-Z0-9\-\_/]*)\.(html|htm)$    /$1.php    [L]
RewriteRule    ^([a-zA-Z0-9\-\_/]*)$    /$1.php    [L]
RewriteRule    ^/date/([a-zA-Z0-9\-\_/]*)/index.php    /index.php?date=$1    [L]

Rewrite

2008 年 5 月 7 日 水曜日

動的なContent-Typeの変更

RewriteEngine on
RewriteRule .* - “[T=application/xhtml+xml; charset=utf-8]”

動的なContent-Typeの設定

2008 年 4 月 12 日 土曜日

PHPで動的なContent-Typeの設定が出来なくて、あたふたして色々調べていたら
『動的なContent-Typeヘッダをmod_layoutに認識させる』
http://module.jp/blog/support_to_dynamic_content_type_in_mod_layout.html
との事です。

mod_layout使ってました・・・商用サーバーの設定はなかなか変えられないのでとりあえず保留

mod_rewriteでなんとかならないかな?