2018年を止めて、2678年にする。
そもそも切支丹(クリスチャン・キリスト教徒)でもないのに切支丹暦を使うのはどうにもおかしなことである。
大東亞戦争時までは使われていた日本の皇紀の方がまだましではないか。
タイでは佛暦が使われている。
今年は2561年。
日本の皇紀・通算暦は2678年。
記事の日付、アーカイブの日付、カレンダーヰジェットの日付などを總て日本暦=日暦で表示するようにしてみた。
日本は切支丹によって殆どが蝕まれていたアジアを解放することのできた唯一の非切支丹國である。
日本は世界の非白民族の最後の希望であった。盟主であった。
人種差別を廃することを世界で最初に國際会議で提案し、戦によって実現してしまった國である。
タイ、ベトナム、カンボジア、ラオス、マレーシア、インドネシア、シンガポール、フィリピン、インドなどのアジアの國が現在、独立国として存在しているのも、大東亞戦争なしにはありえないことであった。
日本は奇跡の國であった。
日本は日本独自の文物を安易に葬り去るべきではない。
西暦とは何ぞ哉?
西暦というのもおかしい。
切支丹暦である。
西にはイスラム教國もあれば佛教國もある。
西の暦と云えば、タイ、ミャンマー、ラオスの佛暦、イスラム暦もあるのだから、それらをないがしろにするとは大失礼ではないか。
ネパールのビクラム暦もある。
Seed Buddhist Year プラグインを利用する方法
プラグイン Seed Buddhist Year をインストールすると、タイの佛暦年で投稿記事の日付が表示されるようになる。
WWP WordPress Popular Post プラグインの記事の日付は切支丹暦のまま。
プラグイン編集で /seed-buddhist-year.php
の200行目を 660 に変更する。
$return .= date_i18n( $year_format, strtotime( "660 years", $time ) );これだけで、日本暦で表示されるようになる。
Seed Buddhist Year は標準で、
* get_the_date()
* the_date()
* get_the_time()
* the_time()
で日付を取得する場合のみ佛暦が表示される。
記事の更新日は、get_the_modified_date で取得されるため、切支丹暦のまま。
そこで、記事の更新日も日暦で表示するためには、
seed-buddhist-year.php の89行目付近に、
add_filter( 'get_the_modified_date', 'seed_buddhist_year_get_the_modified_date', 10, 2 );
を追加する。
add_filter( 'get_the_date', 'seed_buddhist_year_get_the_date', 10, 3 );
add_filter( 'the_date', 'seed_buddhist_year_the_date', 10, 4 );
add_filter( 'get_the_time', 'seed_buddhist_year_get_the_time', 10, 3 );
add_filter( 'the_time', 'seed_buddhist_year_the_time', 10, 2 );
add_filter( 'get_the_modified_date', 'seed_buddhist_year_get_the_modified_date', 10, 2 );
add_filter( 'get_comment_date', 'seed_buddhist_year_get_comment_date', 10, 3 );
add_filter( 'get_comment_time', 'seed_buddhist_year_get_comment_time', 10, 4 );
そして、最後の方にfunction を追加する。
function seed_buddhist_year_get_the_modified_date($content = '', $format = '', $post_input = null) {
global $post;
$get_the_modified_date = null;
if ( is_int( $post_input ) ) {
$post_id = $post_input;
$get_the_modified_date = get_post( $post_id )->post_modified;
} elseif( $post_input !== null ) {
$post_id = $post_input->ID;
$get_the_modified_date = $post_input->post_modified;
} else {
$post_id = $post->ID;
$get_the_modified_date = $post->post_modified;
}
$get_the_modified_date = strtotime( $get_the_modified_date );
if( $format == '' ) {
$format = get_option( 'date_format' );
}
if( seed_is_return_buddhist( $format ) ) {
$return = seed_buddhist_year( $format, $get_the_modified_date );
} else {
$return = $content;
}
return $return;
}
Seed Buddhist Year プラグインを使用する場合、 functions.php は上記の状態から次のように変更する。
/* 日付を切支丹暦から日本暦に変換する */
function wareki($ymdlgi)
{
list($y,$m,$d,$l,$g,$i) = explode("/",$ymdlgi);
$m = str_pad($m,2,0,STR_PAD_LEFT);
$d = str_pad($d,2,0,STR_PAD_LEFT);
$l = str_pad($l,2,0,STR_PAD_LEFT);
$i = str_pad($i,2,0,STR_PAD_LEFT);
$ymdlgi = $y.$m.$d.$l.$g.$i;
$ymd = $y.$m.$d;
$gg1 = "日";
$yy1 = $y + 0;
$gg2 = "佛";
$yy2 = $y - 117;
$gg3 = "切";
$yy3 = $y - 660;
if ( $ymd <= '25720729' ) {
$era = '明治';
$year_ja = $y - 2571;
} elseif ( $ymd >= '26490108' && $ymd <= '26790430' ) {
$era = '平成';
$year_ja = $y - 2648;
} elseif ( $ymd >= '26790501' ) {
$era = '令和';
$year_ja = $y - 2678;
}
if ( $year_ja === 1 ) {
$year_ja = '元';
}
$strm = ltrim($m, '0');
$strd = ltrim($d, '0');
$strl = ltrim($l, '0');
$strg = $g;
$stri = $i;
$wareki = "{$yy1}年{$strm}月{$strd}日・{$strl} {$strg}:{$stri} <br><a href=https://makotoiwasaki.com/日暦皇紀表示.html class=gaireki2><span class=gaireki>({$gg2}{$yy2}・{$gg3}{$yy3}・{$era}{$year_ja}年)</span></a>";
$wareki = preg_replace( '@曜日@', '', $wareki );
return $wareki;
}
function wareki2($ymd)
{
list($y,$m,$d) = explode("/",$ymd);
$m = str_pad($m,2,0,STR_PAD_LEFT);
$d = str_pad($d,2,0,STR_PAD_LEFT);
$ymd = $y.$m.$d;
$gg1 = "日";
$yy1 = $y + 0;
$strm = ltrim($m, '0');
$strd = ltrim($d, '0');
$wareki2 = "{$yy1}.{$strm}.{$strd}";
return $wareki2;
}
function wareki3($ymd)
{
list($y,$m,$d) = explode("/",$ymd);
$m = str_pad($m,2,0,STR_PAD_LEFT);
$d = str_pad($d,2,0,STR_PAD_LEFT);
$ymd = $y.$m.$d;
$gg1 = "日";
$yy1 = $y + 0;
$strm = ltrim($m, '0');
$strd = ltrim($d, '0');
$wareki3 = "{$yy1}年{$strm}月{$strd}日";
return $wareki3;
}
function wareki4($ymd)
{
list($y,$m,$d) = explode("/",$ymd);
$m = str_pad($m,2,0,STR_PAD_LEFT);
$d = str_pad($d,2,0,STR_PAD_LEFT);
$ymd = $y.$m.$d;
$gg1 = "日";
$yy1 = $y + 0;
$strm = ltrim($m, '0');
$strd = ltrim($d, '0');
$wareki4 = "{$yy1}.{$strm}.{$strd}";
return $wareki4;
}
function wareki5($ymd)
{
list($y,$m,$d) = explode("/",$ymd);
$m = str_pad($m,2,0,STR_PAD_LEFT);
$d = str_pad($d,2,0,STR_PAD_LEFT);
$ymd = $y.$m.$d;
$gg1 = "日";
$yy1 = $y + 0;
$gg2 = "佛";
$yy2 = $y - 117;
$gg3 = "切";
$yy3 = $y - 660;
if ( $ymd <= '25720729' ) {
$era = '明治';
$year_ja = $y - 2571;
} elseif ( $ymd >= '26490108' && $ymd <= '26790430' ) {
$era = '平成';
$year_ja = $y - 2648;
} elseif ( $ymd >= '26790501' ) {
$era = '令和';
$year_ja = $y - 2678;
}
if ( $year_ja === 1 ) {
$year_ja = '元';
}
$strm = ltrim($m, '0');
$strd = ltrim($d, '0');
$wareki5 = "{$yy1}年{$strm}月<span class=gaireki>({$gg2}{$yy2}・{$gg3}{$yy3}・{$era}{$year_ja}年)</span>";
return $wareki5;
}
//time は切支丹暦
function wareki6($ymd)
{
list($y,$m,$d) = explode("/",$ymd);
$m = str_pad($m,2,0,STR_PAD_LEFT);
$d = str_pad($d,2,0,STR_PAD_LEFT);
$ymd = $y.$m.$d;
$gg1 = "日";
$yy1 = $y + 0;
$gg2 = "佛";
$yy2 = $y - 117;
$gg3 = "切";
$yy3 = $y - 660;
$strm = ltrim($m, '0');
$strd = ltrim($d, '0');
$wareki6 = "{$yy3}-{$strm}-{$strd}";
return $wareki6;
}
function change_arc_date( $link_html ){
$link_html=str_replace("2019年", "2679年(令和元) ", $link_html);
$link_html=str_replace("2018年", "2678年(平成30) ", $link_html);
$link_html=str_replace("2017年", "2677年", $link_html);
$link_html=str_replace("2016年", "2676年", $link_html);
$link_html=str_replace("2015年", "2675年", $link_html);
$link_html=str_replace("2014年", "2674年", $link_html);
return $link_html;
}
add_filter( 'get_archives_link', 'change_arc_date');
function theme_get_calendar( $calendar_output ) {
$calendar_output = str_replace("2019年", "2679年(令和元)", $calendar_output);
$calendar_output = str_replace("2018年", "2678年(平成30)", $calendar_output);
$calendar_output = str_replace("2017年", "2677年(平成29)", $calendar_output);
$calendar_output = str_replace("2016年", "2676年(平成28)", $calendar_output);
$calendar_output = str_replace("2015年", "2675年(平成27)", $calendar_output);
$calendar_output = str_replace("2014年", "2674年(平成26)", $calendar_output);
return $calendar_output;
}
add_filter( 'get_calendar', 'theme_get_calendar' );
function change_archive_title( $title ) {
$title=str_replace("2019年", "2679年(令和1)", $title);
$title=str_replace("2018年", "2678年(平成30)", $title);
$title=str_replace("2017年", "2677年(平成29)", $title);
$title=str_replace("2016年", "2676年(平成28)", $title);
$title=str_replace("2015年", "2675年(平成27)", $title);
$title=str_replace("2014年", "2674年(平成26)", $title);
return $title;
};
add_filter( 'get_the_archive_title', 'change_archive_title', 10, 1 );
WPP WordPress Popular Posts の日付
wordpress-popular-posts/includes/widget-form.php を直接編集した。
日付の表示フォーマットの選択肢に、Y.m.d を追加した。
functions.php で処理する方がよいのだろうが、わからなかった。
<label title='d/m/Y'><input type='radio' name='<?php echo $this->get_field_name( 'date_format' ); ?>' value='d/m/Y' <?php echo ($instance['stats_tag']['date']['format'] == 'd/m/Y') ? 'checked="checked"' : ''; ?> /><?php echo date_i18n('d/m/Y', time()); ?></label><br />
<label title='Y.m.d'><input type='radio' name='<?php echo $this->get_field_name( 'date_format' ); ?>' value='Y.m.d' <?php echo ($instance['stats_tag']['date']['format'] == 'Y.m.d') ? 'checked="checked"' : ''; ?> /><?php echo date_i18n('Y.m.d', time()); ?></label>
WordPress Popular Post プラグインの記事の日付を変更する。
functions.php の編集。サムネイル取得先変更のついでに年数置換する。
//wppサムネイル取得先変更 暦変更
function change_wpp_thumb( $content, $p ) {
$thumb_html = get_the_post_thumbnail( $p->id, 'wpp348x208' );
preg_match( '!src="([^"]+)"!', $thumb_html, $thumb );
if (has_post_thumbnail($p->id)){//投稿にサムネイルがある場合の処理
$new_content = preg_replace('!<img(.+?)? src="[^"]+"(.+?)>!', '<img$1 src="' . $thumb['1'] . '"$2 alt="' . esc_attr($p->title) . '" title="' . esc_attr($p->title) . '" >', $content );
} else {//サムネイルなしの場合の処理
$new_content = preg_replace('!<img(.+?)? src="[^"]+"(.+?)>!', '<img$1 src="https://makotoiwasaki.com/wp-content/themes/jstork/library/images/noimg.png"$2 alt="' . esc_attr($p->title) . '" title="' . esc_attr($p->title) . '" >', $content );
}
$new_content=str_replace("2019.", "2679.", $new_content);
$new_content=str_replace("2018.", "2678.", $new_content);
$new_content=str_replace("2017.", "2677.", $new_content);
$new_content=str_replace("2016.", "2676.", $new_content);
$new_content=str_replace("2015.", "2675.", $new_content);
$new_content=str_replace("2014.", "2674.", $new_content);
return $new_content;
}
if ( !is_admin() ) add_filter( 'wpp_post', 'change_wpp_thumb', 10, 2 );//管理画面では除外月別アーカイブのタイトルを変更する

Yoast SEO を使用しているので、タイトルの設定を左のようにした。
その上で上のように functions.php に追記する。
Archives Calendar Widget で日本暦を表示する
Archives Calendar Widget はアーカイブをカレンダー形式で表示してくれるWordpressのプラグイン。
これは切支丹暦で表示されるので、日本暦で表示するように、
archives-calendar-widget/arw-widget.php
を次のように編集する。
485行目付近から、
$cal .= '<div class="menu-container ' . $view . '">';
$archiveYear2 = $archiveYear + 660;
if ( $view == "months" ) {
$title_text = $wp_locale->get_month( intval( $archiveMonth ) ) . " " . $archiveYear2;
$title_url = get_month_link( intval( $archiveYear ), intval( $archiveMonth ) );
} else {
$title_text = $archiveYear2;
$title_url = get_year_link( $archiveYear );
}
$title_url = $disable_title_link ? '#' : make_arcw_link( $title_url, $post_type, $cats );
$cal .= '<a href="' . $title_url . '" class="title">' . $title_text . '</a>';
$cal .= '<ul class="menu">';
$i = 0;
foreach ( $pages as $page ) {
if ( $view == "months" ) {
$archivelink = make_arcw_link( get_month_link( intval( $page->year ), intval( $page->month ) ), $post_type, $cats );
$linkclass = $page->year . ' ' . $page->month;
$linktext = $wp_locale->get_month( intval( $page->month ) ) . ' ' . ($page->year + 660);
} else {
$archivelink = make_arcw_link( get_year_link( $page ), $post_type, $cats );
$linkclass = $page;
$page2 = $page + 660;
$linktext = $page2;
$linktext2 = $page;
}
$current = ( ( $view == 'months' && $archiveYear == $page->year && $archiveMonth == $page->month ) || ( $view == "years" && $archiveYear == $page ) ) ? ' current' : '';
$cal .= '<li><a href="' . $archivelink . '" class="' . $linkclass . $current . '" rel="' . $i . '" >' . $linktext . '</a></li>';
$i ++;
}diff で差分比較:
# diff arw-widget.php arw-widget.php.org 486c486 < $archiveYear2 = $archiveYear + 660; --- > 488c488 < $title_text = $wp_locale->get_month( intval( $archiveMonth ) ) . " " . $archiveYear2; --- > $title_text = $wp_locale->get_month( intval( $archiveMonth ) ) . " " . $archiveYear; 491c491 < $title_text = $archiveYear2; --- > $title_text = $archiveYear; 505c505 < $linktext = $wp_locale->get_month( intval( $page->month ) ) . ' ' . ($page->year + 660); --- > $linktext = $wp_locale->get_month( intval( $page->month ) ) . ' ' . $page->year; 509,511c509 < $page2 = $page + 660; < $linktext = $page2; < $linktext2 = $page; --- > $linktext = $page;
これで次の頁のように表示される。
アーカイブのURLをRewrite & Redirect
年月別のアーカイブ、過去記事リストの頁のURLは、
/2019/03
のようになり、切支丹歴が標準となっている。
これを、
/2679/03
でアクセスできるようにRewrite設定する。
また、/2019/03 にアクセスすると、/2679/03 に飛ばされるように、Redirect の設定も行う。
Rewrite設定
functions.php に次を追加する。
function custom_rewrite_basic() {
add_rewrite_rule('2679/?$' , 'index.php?year=2019', 'top');
add_rewrite_rule('2679/([0-9]{1,2})/?$' , 'index.php?year=2019&monthnum=$matches[1]', 'top');
add_rewrite_rule('2679/([0-9]{1,2})/([0-9]{1,2})/?$' , 'index.php?year=2019&monthnum=$matches[1]&day=$matches[2]', 'top');
add_rewrite_rule('2679/page/?([0-9]{1,})/?$' , 'index.php?year=2019&paged=$matches[1]', 'top');
add_rewrite_rule('2679/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2019&monthnum=$matches[1]&paged=$matches[2]', 'top');
add_rewrite_rule('2679/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2019]&monthnum=$matches[1]&day=$matches[2]&paged=$matches[3]', 'top');
add_rewrite_rule('2678/?$' , 'index.php?year=2018', 'top');
add_rewrite_rule('2678/([0-9]{1,2})/?$' , 'index.php?year=2018&monthnum=$matches[1]', 'top');
add_rewrite_rule('2678/([0-9]{1,2})/([0-9]{1,2})/?$' , 'index.php?year=2018&monthnum=$matches[1]&day=$matches[2]', 'top');
add_rewrite_rule('2678/page/?([0-9]{1,})/?$' , 'index.php?year=2018&paged=$matches[1]', 'top');
add_rewrite_rule('2678/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2018&monthnum=$matches[1]&paged=$matches[2]', 'top');
add_rewrite_rule('2678/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2018]&monthnum=$matches[1]&day=$matches[2]&paged=$matches[3]', 'top');
add_rewrite_rule('2677/?$' , 'index.php?year=2017', 'top');
add_rewrite_rule('2677/([0-9]{1,2})/?$' , 'index.php?year=2017&monthnum=$matches[1]', 'top');
add_rewrite_rule('2677/([0-9]{1,2})/([0-9]{1,2})/?$' , 'index.php?year=2017&monthnum=$matches[1]&day=$matches[2]', 'top');
add_rewrite_rule('2677/page/?([0-9]{1,})/?$' , 'index.php?year=2017&paged=$matches[1]', 'top');
add_rewrite_rule('2677/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2017&monthnum=$matches[1]&paged=$matches[2]', 'top');
add_rewrite_rule('2677/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2017]&monthnum=$matches[1]&day=$matches[2]&paged=$matches[3]', 'top');
add_rewrite_rule('2676/?$' , 'index.php?year=2016', 'top');
add_rewrite_rule('2676/([0-9]{1,2})/?$' , 'index.php?year=2016&monthnum=$matches[1]', 'top');
add_rewrite_rule('2676/([0-9]{1,2})/([0-9]{1,2})/?$' , 'index.php?year=2016&monthnum=$matches[1]&day=$matches[2]', 'top');
add_rewrite_rule('2676/page/?([0-9]{1,})/?$' , 'index.php?year=2016&paged=$matches[1]', 'top');
add_rewrite_rule('2676/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2016&monthnum=$matches[1]&paged=$matches[2]', 'top');
add_rewrite_rule('2676/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2016]&monthnum=$matches[1]&day=$matches[2]&paged=$matches[3]', 'top');
add_rewrite_rule('2675/?$' , 'index.php?year=2015', 'top');
add_rewrite_rule('2675/([0-9]{1,2})/?$' , 'index.php?year=2015&monthnum=$matches[1]', 'top');
add_rewrite_rule('2675/([0-9]{1,2})/([0-9]{1,2})/?$' , 'index.php?year=2015&monthnum=$matches[1]&day=$matches[2]', 'top');
add_rewrite_rule('2675/page/?([0-9]{1,})/?$' , 'index.php?year=2015&paged=$matches[1]', 'top');
add_rewrite_rule('2675/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2015&monthnum=$matches[1]&paged=$matches[2]', 'top');
add_rewrite_rule('2675/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2015]&monthnum=$matches[1]&day=$matches[2]&paged=$matches[3]', 'top');
add_rewrite_rule('2674/?$' , 'index.php?year=2014', 'top');
add_rewrite_rule('2674/([0-9]{1,2})/?$' , 'index.php?year=2014&monthnum=$matches[1]', 'top');
add_rewrite_rule('2674/([0-9]{1,2})/([0-9]{1,2})/?$' , 'index.php?year=2014&monthnum=$matches[1]&day=$matches[2]', 'top');
add_rewrite_rule('2674/page/?([0-9]{1,})/?$' , 'index.php?year=2014&paged=$matches[1]', 'top');
add_rewrite_rule('2674/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2014&monthnum=$matches[1]&paged=$matches[2]', 'top');
add_rewrite_rule('2674/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' , 'index.php?year=2014]&monthnum=$matches[1]&day=$matches[2]&paged=$matches[3]', 'top');
add_rewrite_rule('([0-9]{4})/([0-9]{1,2})/([^/]+).html(?:/([0-9]+))?/?$' , 'index.php?name=$matches[3]&page=$matches[4]', 'top');
}
add_action('init', 'custom_rewrite_basic');最後の一行は投稿記事のパーマリンクを
/2019/08/スラッグ名.html
の形式から、
年月表示を抜いて、
/スラッグ名.html
に変更する場合に有効。
add_rewrite_rule('([0-9]{4})/([0-9]{1,2})/([^/]+).html(?:/([0-9]+))?/?$' , 'index.php?name=$matches[3]&page=$matches[4]', 'top');
Rewrite Rules Inspector プラグインを使用すると、Rewrite Rules の構造がよく分かる。
Redirect の設定
Redirections プラグインを利用する。
次のように正規表現で転送設定する。
^/2019/([0-9]{1,2})/?$ /2679/$1
^/2019/([0-9]{1,2})/([0-9]{1,2})/?$ /2679/$1/$2
^/2018/([0-9]{1,2})/?$ /2678/$1
^/2017/([0-9]{1,2})/?$ /2677/$1
^/2016/([0-9]{1,2})/?$ /2676/$1
^/2015/([0-9]{1,2})/?$ /2675/$1
^/2014/([0-9]{1,2})/?$ /2674/$1
^/2018/([0-9]{1,2})/([0-9]{1,2})/?$ /2678/$1/$2
^/2017/([0-9]{1,2})/([0-9]{1,2})/?$ /2677/$1/$2
^/2016/([0-9]{1,2})/([0-9]{1,2})/?$ /2676/$1/$2
^/2015/([0-9]{1,2})/([0-9]{1,2})/?$ /2675/$1/$2
^/2014/([0-9]{1,2})/([0-9]{1,2})/?$ /2674/$1/$2
/2019/?$ /2679
/2018/?$ /2678
/2017/?$ /2677
/2016/?$ /2676
/2015/?$ /2675
/2014/?$ /2674
次の転送設定は、年月表示を抜いて、
/スラッグ名.html
にパーマリンクを変更する場合に有効。
"^/\d{4}/\d{2}/(.*).html","/$1.html",
Nginx で rewrite 設定する場合
Redirections プラグインを使用しないで、Nginx の conf にrewrite の設定をする方が速いかもしれない。
server { } の中に記述する。
server {
# error_log /home/kusanagi/www/log/nginx/ssl_error.log notice;
#rewrite_log on;
rewrite "(?i)^/2019/([0-9]{1,2})/?$" /2679/$1 permanent;
rewrite "(?i)^/2019/([0-9]{1,2})/([0-9]{1,2})/?$" /2679/$1/$2 permanent;
rewrite "(?i)^/2018/([0-9]{1,2})/?$" /2678/$1 permanent;
rewrite "(?i)^/2017/([0-9]{1,2})/?$" /2677/$1 permanent;
rewrite "(?i)^/2016/([0-9]{1,2})/?$" /2676/$1 permanent;
rewrite "(?i)^/2015/([0-9]{1,2})/?$" /2675/$1 permanent;
rewrite "(?i)^/2014/([0-9]{1,2})/?$" /2674/$1 permanent;
rewrite "(?i)^/2018/([0-9]{1,2})/([0-9]{1,2})/?$" /2678/$1/$2 permanent;
rewrite "(?i)^/2017/([0-9]{1,2})/([0-9]{1,2})/?$" /2677/$1/$2 permanent;
rewrite "(?i)^/2016/([0-9]{1,2})/([0-9]{1,2})/?$" /2676/$1/$2 permanent;
rewrite "(?i)^/2015/([0-9]{1,2})/([0-9]{1,2})/?$" /2675/$1/$2 permanent;
rewrite "(?i)^/2014/([0-9]{1,2})/([0-9]{1,2})/?$" /2674/$1/$2 permanent;
rewrite "(?i)^/2019/?$" /2679 permanent;
rewrite "(?i)^/2018/?$" /2678 permanent;
rewrite "(?i)^/2017/?$" /2677 permanent;
rewrite "(?i)^/2016/?$" /2676 permanent;
rewrite "(?i)^/2015/?$" /2675 permanent;
rewrite "(?i)^/2014/?$" /2674 permanent;
rewrite "(?i)^/\d{4}/\d{2}/(.*).html$" /$1.html permanent;
}この書式は、 Redirections プラグインで設定した後に、export できる。
そして、最初の置換前の正規表現の部分は " " で囲まないとエラーになるので注意。
rewrite_log on;
にして、
error.log notice
以上にすると rewrite_log が記録される。
grep rewritten error.log
で、rewrite されたという部分のみ抽出できる。
史上初の日本暦・皇紀採用のブログ ?
以上の設定で、表面上は切支丹歴の年数字がアドレスバーに現れることはなくなった。
ブログの記事に日暦・皇紀を採用しているのは世界中でこのサイトのみかもしれない。








