{"id":96,"date":"2026-09-02T18:40:35","date_gmt":"2026-09-02T09:40:35","guid":{"rendered":"https:\/\/motoki-design.co.jp\/tools\/htaccess-redirect\/"},"modified":"2026-09-02T18:50:16","modified_gmt":"2026-09-02T09:50:16","slug":"htaccess-redirect","status":"publish","type":"page","link":"https:\/\/motoki-design.co.jp\/tools\/htaccess-redirect\/","title":{"rendered":".htaccess\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u751f\u6210\u30c4\u30fc\u30eb"},"content":{"rendered":"\n<div id=\"wt-htaccess\" class=\"wt-tool\">\n\t<p class=\"wt-lead\">\u65e7URL\u3068\u65b0URL\u306e\u5bfe\u5fdc\u8868\u3092\u8cbc\u308a\u4ed8\u3051\u308b\u3060\u3051\u3067\u3001<strong>.htaccess \u306b\u66f8\u304f301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u8a18\u8ff0\u3092\u751f\u6210<\/strong>\u3057\u307e\u3059\u3002www\u7d71\u4e00\u30fb\u5e38\u6642SSL\u5316\u30fb\u672b\u5c3e\u30b9\u30e9\u30c3\u30b7\u30e5\u7d71\u4e00\u306e\u5b9a\u756a\u30d1\u30bf\u30fc\u30f3\u3082\u30dc\u30bf\u30f3\u3072\u3068\u3064\u3067\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002\u30b5\u30a4\u30c8\u30ea\u30cb\u30e5\u30fc\u30a2\u30eb\u3084\u30c9\u30e1\u30a4\u30f3\u79fb\u8ee2\u306e\u3068\u304d\u306b\u3069\u3046\u305e\u3002<\/p>\n\n\t<div class=\"wt-policy\" style=\"border-color:#cfe3cf;background:#f3faf3;margin-top:0\">\n\t\t<p class=\"wt-policy-title\">\ud83d\udd12 \u3053\u306e\u51e6\u7406\u306f\u30d6\u30e9\u30a6\u30b6\u306e\u4e2d\u3060\u3051\u3067\u5b8c\u7d50\u3057\u307e\u3059<\/p>\n\t\t<ul>\n\t\t\t<li>\u5165\u529b\u3057\u305fURL\u306f<strong>\u30b5\u30fc\u30d0\u30fc\u306b\u4e00\u5207\u9001\u4fe1\u3055\u308c\u307e\u305b\u3093<\/strong>\u3002\u304a\u4f7f\u3044\u306e\u30d6\u30e9\u30a6\u30b6\u306e\u4e2d\u3060\u3051\u3067\u5909\u63db\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n\t\t\t<li>\u901a\u4fe1\u304c\u767a\u751f\u3057\u306a\u3044\u305f\u3081\u3001\u793e\u5916\u306b\u51fa\u305b\u306a\u3044URL\u3067\u3082\u5b89\u5fc3\u3057\u3066\u304a\u4f7f\u3044\u3044\u305f\u3060\u3051\u307e\u3059\u3002<\/li>\n\t\t<\/ul>\n\t<\/div>\n\n\t<form class=\"wt-form\" style=\"margin-top:1.2em\" onsubmit=\"return false\">\n\t\t<div class=\"wt-field\">\n\t\t\t<label for=\"wt-ht-input\">\u65e7URL\u3068\u65b0URL\u306e\u5bfe\u5fdc\u8868\uff081\u884c\u306b1\u7d44\u3002\u30bf\u30d6\u30fb\u30ab\u30f3\u30de\u30fb\u30b9\u30da\u30fc\u30b9\u306e\u3069\u308c\u3067\u533a\u5207\u3063\u3066\u3082OK\uff09<\/label>\n\t\t\t<textarea id=\"wt-ht-input\" class=\"wt-input\" rows=\"8\" spellcheck=\"false\" placeholder=\"\/old-page\/\t\/new-page\/\n\/company\/about.html\t\/about\/\nhttps:\/\/example.co.jp\/blog\/1\thttps:\/\/example.co.jp\/news\/hello\/\"><\/textarea>\n\t\t<\/div>\n\n\t\t<div class=\"wt-fields\">\n\t\t\t<div class=\"wt-field\">\n\t\t\t\t<label for=\"wt-ht-mode\">\u51fa\u529b\u3059\u308b\u66f8\u304d\u65b9<\/label>\n\t\t\t\t<select id=\"wt-ht-mode\" class=\"wt-select\" style=\"width:100%\">\n\t\t\t\t\t<option value=\"redirect\">Redirect 301\uff08\u30b7\u30f3\u30d7\u30eb\u30fb\u63a8\u5968\uff09<\/option>\n\t\t\t\t\t<option value=\"rewrite\">RewriteRule\uff08\u7d30\u304b\u304f\u5236\u5fa1\u3057\u305f\u3044\u3068\u304d\uff09<\/option>\n\t\t\t\t\t<option value=\"match\">RedirectMatch\uff08\u6b63\u898f\u8868\u73fe\u3067\u66f8\u304d\u305f\u3044\u3068\u304d\uff09<\/option>\n\t\t\t\t<\/select>\n\t\t\t<\/div>\n\t\t\t<div class=\"wt-field\">\n\t\t\t\t<label for=\"wt-ht-domain\">\u30b5\u30a4\u30c8\u306e\u30c9\u30e1\u30a4\u30f3\uff08\u7d71\u4e00\u30eb\u30fc\u30eb\u7528\uff09<\/label>\n\t\t\t\t<input id=\"wt-ht-domain\" type=\"text\" placeholder=\"example.co.jp\" spellcheck=\"false\" autocapitalize=\"off\">\n\t\t\t<\/div>\n\t\t<\/div>\n\n\t\t<div class=\"wt-fields\" style=\"margin-top:.8em\">\n\t\t\t<div class=\"wt-field\"><label><input type=\"checkbox\" id=\"wt-ht-ssl\" checked> \u5e38\u6642SSL\u5316\uff08http\u2192https\uff09\u3092\u8ffd\u52a0<\/label><\/div>\n\t\t\t<div class=\"wt-field\"><label><input type=\"checkbox\" id=\"wt-ht-www\"> www\u306a\u3057\u306b\u7d71\u4e00\u3059\u308b<\/label><\/div>\n\t\t\t<div class=\"wt-field\"><label><input type=\"checkbox\" id=\"wt-ht-wwwadd\"> www\u3042\u308a\u306b\u7d71\u4e00\u3059\u308b<\/label><\/div>\n\t\t\t<div class=\"wt-field\"><label><input type=\"checkbox\" id=\"wt-ht-slash\"> \u672b\u5c3e\u30b9\u30e9\u30c3\u30b7\u30e5\u3092\u4ed8\u3051\u308b<\/label><\/div>\n\t\t<\/div>\n\n\t\t<div class=\"wt-row\" style=\"margin-top:1em\">\n\t\t\t<button class=\"wt-btn\" type=\"button\" id=\"wt-ht-run\">\u751f\u6210\u3059\u308b<\/button>\n\t\t<\/div>\n\t<\/form>\n\n\t<div class=\"wt-status\" hidden><\/div>\n\t<div class=\"wt-result\" hidden><\/div>\n\n\t<div class=\"wt-disclaimer\">\n\t\t<strong>\u4f7f\u3046\u3068\u304d\u306e\u6ce8\u610f<\/strong><br>\n\t\t\u751f\u6210\u3057\u305f\u8a18\u8ff0\u306f\u3001<strong>WordPress\u306e\u30eb\u30fc\u30eb\u30d6\u30ed\u30c3\u30af\uff08<code># BEGIN WordPress<\/code>\u301c<code># END WordPress<\/code>\uff09\u3088\u308a\u524d<\/strong>\u306b\u8cbc\u308a\u4ed8\u3051\u3066\u304f\u3060\u3055\u3044\u3002\u5f8c\u308d\u306b\u66f8\u304f\u3068WordPress\u5074\u306e\u30eb\u30fc\u30eb\u304c\u5148\u306b\u51e6\u7406\u3055\u308c\u3066\u52b9\u304b\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u53cd\u6620\u5f8c\u306f\u5fc5\u305a\u30d6\u30e9\u30a6\u30b6\u3067\u8ee2\u9001\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\uff08<a href=\"\/tools\/redirect-check\/\">\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u30c1\u30a7\u30c3\u30af<\/a>\u3067\u691c\u8a3c\u3067\u304d\u307e\u3059\uff09\u3002<code>.htaccess<\/code> \u306f\u66f8\u304d\u65b9\u30921\u6587\u5b57\u9593\u9055\u3048\u308b\u3068\u30b5\u30a4\u30c8\u5168\u4f53\u304c500\u30a8\u30e9\u30fc\u306b\u306a\u308b\u305f\u3081\u3001<strong>\u7de8\u96c6\u524d\u306b\u5fc5\u305a\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/strong>\u3092\u53d6\u3063\u3066\u304f\u3060\u3055\u3044\u3002Nginx\u3092\u304a\u4f7f\u3044\u306e\u5834\u5408\u306f\u3053\u306e\u66f8\u304d\u65b9\u306f\u4f7f\u3048\u307e\u305b\u3093\u3002\n\t<\/div>\n\n\t<div class=\"wt-faq\">\n\t\t<details>\n\t\t\t<summary>Redirect 301 \u3068 RewriteRule \u306f\u3069\u3061\u3089\u3092\u4f7f\u3046\u3079\u304d\u3067\u3059\u304b\uff1f<\/summary>\n\t\t\t<p>\u5358\u7d14\u306a1\u5bfe1\u306e\u8ee2\u9001\u306a\u3089 <strong>Redirect 301 \u3067\u5341\u5206<\/strong>\u3067\u3001\u8aad\u307f\u3084\u3059\u304f\u4e8b\u6545\u3082\u8d77\u304d\u306b\u304f\u3044\u3067\u3059\u3002RewriteRule \u306f\u300c\u30af\u30a8\u30ea\u6587\u5b57\u5217\u306e\u6709\u7121\u3067\u5206\u5c90\u3057\u305f\u3044\u300d\u300c\u7279\u5b9a\u6761\u4ef6\u306e\u3068\u304d\u3060\u3051\u8ee2\u9001\u3057\u305f\u3044\u300d\u3068\u3044\u3063\u305f\u7d30\u304b\u3044\u5236\u5fa1\u304c\u5fc5\u8981\u306a\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002RedirectMatch \u306f\u6b63\u898f\u8868\u73fe\u3067\u307e\u3068\u3081\u3066\u8ee2\u9001\u3057\u305f\u3044\u3068\u304d\uff08\u4f8b\uff1a<code>\/blog\/(.*)<\/code> \u3092 <code>\/news\/$1<\/code> \u3078\uff09\u306b\u5411\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n\t\t<\/details>\n\t\t<details>\n\t\t\t<summary>301\u3068302\u3001\u3069\u3061\u3089\u3092\u6307\u5b9a\u3059\u308c\u3070\u3044\u3044\u3067\u3059\u304b\uff1f<\/summary>\n\t\t\t<p>\u30b5\u30a4\u30c8\u30ea\u30cb\u30e5\u30fc\u30a2\u30eb\u3084URL\u5909\u66f4\u306e\u3088\u3046\u306a<strong>\u6052\u4e45\u7684\u306a\u79fb\u52d5\u306f\u5fc5\u305a301<\/strong>\u3067\u3059\u3002301\u306a\u3089\u65e7URL\u306e\u691c\u7d22\u8a55\u4fa1\u304c\u65b0URL\u306b\u5f15\u304d\u7d99\u304c\u308c\u307e\u3059\u3002302\u306f\u300c\u30ad\u30e3\u30f3\u30da\u30fc\u30f3\u671f\u9593\u4e2d\u3060\u3051\u5225\u30da\u30fc\u30b8\u3092\u898b\u305b\u308b\u300d\u3068\u3044\u3063\u305f\u4e00\u6642\u7684\u306a\u7528\u9014\u306b\u9650\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30c4\u30fc\u30eb\u306f\u5e38\u306b301\u3067\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\n\t\t<\/details>\n\t\t<details>\n\t\t\t<summary>\u8ee2\u9001\u304c\u52b9\u304d\u307e\u305b\u3093<\/summary>\n\t\t\t<p>\u3088\u304f\u3042\u308b\u539f\u56e0\u306f3\u3064\u3067\u3059\u3002(1) WordPress\u306e\u30eb\u30fc\u30eb\u30d6\u30ed\u30c3\u30af\u3088\u308a\u5f8c\u308d\u306b\u66f8\u3044\u3066\u3044\u308b\u3001(2) \u30d6\u30e9\u30a6\u30b6\u304c301\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3057\u3066\u3044\u308b\uff08\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30a6\u30a3\u30f3\u30c9\u30a6\u3067\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\uff09\u3001(3) \u30b5\u30fc\u30d0\u30fc\u304c <code>AllowOverride<\/code> \u3067 .htaccess \u3092\u7121\u52b9\u306b\u3057\u3066\u3044\u308b\u3002\u307e\u305f\u3001\u8ee2\u9001\u5143\u306eURL\u304c\u5b9f\u5728\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3084\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u5834\u5408\u3001\u305d\u3061\u3089\u304c\u512a\u5148\u3055\u308c\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\t\t<\/details>\n\t<\/div>\n<\/div>\n\n<div class=\"wt-tool\"><div class=\"wt-policy\"><p class=\"wt-policy-title\">\ud83d\udd12 \u8abf\u3079\u305f\u5185\u5bb9\u306f\u8a18\u9332\u30fb\u516c\u958b\u3057\u307e\u305b\u3093<\/p><ul><li><strong>\u691c\u7d22\u3057\u305f\u5185\u5bb9\u3092\u4fdd\u5b58\u30fb\u4e00\u89a7\u5316\u30fb\u516c\u958b\u3057\u307e\u305b\u3093\u3002<\/strong>\u8abf\u67fb\u7d50\u679c\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5316\u3057\u3066\u691c\u7d22\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u308a\u3001\u4ed6\u306e\u5229\u7528\u8005\u306b\u898b\u305b\u305f\u308a\u3059\u308b\u3053\u3068\u306f\u4e00\u5207\u3042\u308a\u307e\u305b\u3093\u3002<\/li><li><strong>\u691c\u7d22\u5c65\u6b74\u3092\u6b8b\u3057\u307e\u305b\u3093\u3002<\/strong>\u8ab0\u304c\u4f55\u3092\u8abf\u3079\u305f\u304b\u3092\u7d10\u3065\u3051\u3066\u84c4\u7a4d\u3059\u308b\u3053\u3068\u306f\u3057\u307e\u305b\u3093\u3002\u4f1a\u54e1\u767b\u9332\u30fb\u30ed\u30b0\u30a4\u30f3\u3082\u4e0d\u8981\u3067\u3059\u3002<\/li><li><strong>\u7b2c\u4e09\u8005\u306b\u63d0\u4f9b\u30fb\u8ca9\u58f2\u3057\u307e\u305b\u3093\u3002<\/strong>\u55b6\u696d\u30ea\u30b9\u30c8\u3084\u5e83\u544a\u76ee\u7684\u3067\u306e\u5229\u7528\u3082\u3042\u308a\u307e\u305b\u3093\u3002<\/li><li>\u30b5\u30fc\u30d0\u30fc\u8ca0\u8377\u3092\u6291\u3048\u308b\u305f\u3081\u3001<strong>\u5224\u5b9a\u7d50\u679c\u306e\u307f\u6700\u59271\u6642\u9593\u306e\u4e00\u6642\u30ad\u30e3\u30c3\u30b7\u30e5<\/strong>\u306b\u4fdd\u6301\u3057\u3001\u6642\u9593\u306e\u7d4c\u904e\u3067\u81ea\u52d5\u7684\u306b\u6d88\u3048\u307e\u3059\u3002\u9023\u7d9a\u30a2\u30af\u30bb\u30b9\u306e\u5236\u9650\u7528\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092<strong>\u30cf\u30c3\u30b7\u30e5\u5316\u3057\u305f\u5024<\/strong>\u3092\u6700\u592710\u5206\u9593\u3060\u3051\u4fdd\u6301\u3057\u307e\u3059\uff08\u5143\u306eIP\u30a2\u30c9\u30ec\u30b9\u306f\u4fdd\u5b58\u3057\u307e\u305b\u3093\uff09\u3002<\/li><li>\u8abf\u3079\u305f\u5bfe\u8c61\u306f\u5171\u6709\u7528\u306bURL\u306e<code>#<\/code>\u4ee5\u964d\u306b\u4ed8\u304d\u307e\u3059\u304c\u3001\u3053\u306e\u90e8\u5206\u306f\u30b5\u30fc\u30d0\u30fc\u306b\u3082\u30a2\u30af\u30bb\u30b9\u89e3\u6790\u306b\u3082\u9001\u4fe1\u3055\u308c\u307e\u305b\u3093\u3002<\/li><\/ul><\/div><\/div>\n\n<script>\n(function () {\n\tvar root = document.getElementById('wt-htaccess');\n\tif (!root || !window.WT) return;\n\tvar W = WT;\n\tvar resultBox = root.querySelector('.wt-result');\n\tvar statusBox = root.querySelector('.wt-status');\n\n\tfunction path(url) {\n\t\t\/\/ \u7d76\u5bfeURL\u306a\u3089\u30d1\u30b9\u4ee5\u964d\u3060\u3051\u3092\u53d6\u308a\u51fa\u3059\n\t\tvar m = String(url).trim().match(\/^https?:\\\/\\\/[^\/]+(\\\/.*)?$\/i);\n\t\tif (m) return m[1] || '\/';\n\t\tvar v = String(url).trim();\n\t\treturn v.charAt(0) === '\/' ? v : '\/' + v;\n\t}\n\n\tfunction esc(s) { return W.esc(s); }\n\n\tfunction build() {\n\t\tvar raw = document.getElementById('wt-ht-input').value;\n\t\tvar mode = document.getElementById('wt-ht-mode').value;\n\t\tvar domain = document.getElementById('wt-ht-domain').value.trim().replace(\/^https?:\\\/\\\/\/, '').replace(\/\\\/.*$\/, '');\n\t\tvar wantSsl = document.getElementById('wt-ht-ssl').checked;\n\t\tvar wwwOff = document.getElementById('wt-ht-www').checked;\n\t\tvar wwwOn = document.getElementById('wt-ht-wwwadd').checked;\n\t\tvar slash = document.getElementById('wt-ht-slash').checked;\n\n\t\tvar pairs = [], problems = [], seen = {};\n\t\traw.split(\/\\r?\\n\/).forEach(function (line, i) {\n\t\t\tline = line.trim();\n\t\t\tif (!line || line.charAt(0) === '#') return;\n\t\t\tvar parts = line.split(\/[\\t,]+|\\s{1,}\/).filter(function (p) { return p; });\n\t\t\tif (parts.length < 2) {\n\t\t\t\tproblems.push({ status: 'warn', title: (i + 1) + '\u884c\u76ee\uff1a2\u3064\u76ee\u306eURL\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093', note: line });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar from = path(parts[0]), to = parts[1].trim();\n\t\t\tif (!\/^https?:\\\/\\\/\/i.test(to)) to = path(to);\n\t\t\tif (from === to) {\n\t\t\t\tproblems.push({ status: 'warn', title: (i + 1) + '\u884c\u76ee\uff1a\u8ee2\u9001\u5143\u3068\u8ee2\u9001\u5148\u304c\u540c\u3058\u3067\u3059', note: from + ' \u2192 ' + to + '\uff08\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u305f\u3081\u9664\u5916\u3057\u307e\u3057\u305f\uff09' });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (seen[from]) {\n\t\t\t\tproblems.push({ status: 'ng', title: (i + 1) + '\u884c\u76ee\uff1a\u8ee2\u9001\u5143\u304c\u91cd\u8907\u3057\u3066\u3044\u307e\u3059', note: from + ' \u306f\u65e2\u306b\u6307\u5b9a\u6e08\u307f\u3067\u3059\u3002\u5148\u306b\u66f8\u3044\u305f\u30eb\u30fc\u30eb\u304c\u512a\u5148\u3055\u308c\u3001\u5f8c\u306e\u3082\u306e\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002' });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tseen[from] = true;\n\t\t\tpairs.push([from, to]);\n\t\t});\n\n\t\tvar lines = [];\n\t\tvar needRewrite = wantSsl || wwwOff || wwwOn || slash || mode === 'rewrite';\n\n\t\tif (needRewrite) {\n\t\t\tlines.push('<IfModule mod_rewrite.c>');\n\t\t\tlines.push('RewriteEngine On');\n\t\t\tif (wantSsl) {\n\t\t\t\tlines.push('');\n\t\t\t\tlines.push('# \u5e38\u6642SSL\u5316\uff08http \u2192 https\uff09');\n\t\t\t\tlines.push('RewriteCond %{HTTPS} !=on');\n\t\t\t\tlines.push('RewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [R=301,L]');\n\t\t\t}\n\t\t\tif (wwwOff && domain) {\n\t\t\t\tlines.push('');\n\t\t\t\tlines.push('# www\u306a\u3057\u306b\u7d71\u4e00');\n\t\t\t\tlines.push('RewriteCond %{HTTP_HOST} ^www\\\\.' + domain.replace(\/\\.\/g, '\\\\.') + '$ [NC]');\n\t\t\t\tlines.push('RewriteRule ^(.*)$ https:\/\/' + domain + '\/$1 [R=301,L]');\n\t\t\t}\n\t\t\tif (wwwOn && domain) {\n\t\t\t\tlines.push('');\n\t\t\t\tlines.push('# www\u3042\u308a\u306b\u7d71\u4e00');\n\t\t\t\tlines.push('RewriteCond %{HTTP_HOST} ^' + domain.replace(\/\\.\/g, '\\\\.') + '$ [NC]');\n\t\t\t\tlines.push('RewriteRule ^(.*)$ https:\/\/www.' + domain + '\/$1 [R=301,L]');\n\t\t\t}\n\t\t\tif (slash) {\n\t\t\t\tlines.push('');\n\t\t\t\tlines.push('# \u672b\u5c3e\u30b9\u30e9\u30c3\u30b7\u30e5\u3092\u4ed8\u3051\u308b\uff08\u5b9f\u5728\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u9664\u304f\uff09');\n\t\t\t\tlines.push('RewriteCond %{REQUEST_FILENAME} !-f');\n\t\t\t\tlines.push('RewriteRule ^(.*[^\/])$ \/$1\/ [R=301,L]');\n\t\t\t}\n\t\t}\n\n\t\tif (pairs.length) {\n\t\t\tif (mode === 'rewrite') {\n\t\t\t\tlines.push('');\n\t\t\t\tlines.push('# \u500b\u5225\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8');\n\t\t\t\tpairs.forEach(function (p) {\n\t\t\t\t\tlines.push('RewriteRule ^' + p[0].replace(\/^\\\/\/, '').replace(\/([.?*+^$[\\]\\\\(){}|-])\/g, '\\\\$1') + '$ ' + p[1] + ' [R=301,L]');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (needRewrite) lines.push('<\/IfModule>');\n\n\t\tif (pairs.length && mode !== 'rewrite') {\n\t\t\tif (lines.length) lines.push('');\n\t\t\tlines.push('# \u500b\u5225\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8');\n\t\t\tpairs.forEach(function (p) {\n\t\t\t\tif (mode === 'match') {\n\t\t\t\t\tlines.push('RedirectMatch 301 ^' + p[0].replace(\/([.?*+^$[\\]\\\\(){}|-])\/g, '\\\\$1') + '$ ' + p[1]);\n\t\t\t\t} else {\n\t\t\t\t\tlines.push('Redirect 301 ' + p[0] + ' ' + p[1]);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tvar code = lines.join('\\n').replace(\/\\n{3,}\/g, '\\n\\n').trim();\n\n\t\tvar html = '';\n\t\tif (!code) {\n\t\t\tstatusBox.hidden = false;\n\t\t\tstatusBox.className = 'wt-status is-error';\n\t\t\tstatusBox.textContent = '\u751f\u6210\u3059\u308b\u5185\u5bb9\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u5bfe\u5fdc\u8868\u3092\u5165\u529b\u3059\u308b\u304b\u3001\u7d71\u4e00\u30eb\u30fc\u30eb\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044\u3002';\n\t\t\tresultBox.hidden = true;\n\t\t\treturn;\n\t\t}\n\t\tstatusBox.hidden = true;\n\n\t\thtml += W.head(problems.some(function (p) { return p.status === 'ng'; }) ? 'warn' : 'ok',\n\t\t\t'\u751f\u6210\u7d50\u679c', W.esc(pairs.length + ' \u4ef6\u306e\u8ee2\u9001\u30eb\u30fc\u30eb\u3092\u751f\u6210\u3057\u307e\u3057\u305f'),\n\t\t\t[needRewrite ? '\u7d71\u4e00\u30eb\u30fc\u30eb\u3082\u542b\u3081\u3066\u3044\u307e\u3059\u3002' : '']);\n\n\t\thtml += '<h3 class=\"wt-h\">.htaccess \u306b\u8cbc\u308a\u4ed8\u3051\u308b\u5185\u5bb9<\/h3>';\n\t\thtml += '<div class=\"wt-toolbar\"><button type=\"button\" class=\"wt-mini\" id=\"wt-ht-copy\">\u30b3\u30d4\u30fc<\/button>' +\n\t\t\t'<button type=\"button\" class=\"wt-mini\" id=\"wt-ht-dl\">.htaccess \u3068\u3057\u3066\u4fdd\u5b58<\/button><\/div>';\n\t\thtml += '<pre class=\"wt-code\" id=\"wt-ht-code\">' + esc(code) + '<\/pre>';\n\t\thtml += '<p class=\"wt-note\">WordPress\u306e\u30eb\u30fc\u30eb\u30d6\u30ed\u30c3\u30af\uff08# BEGIN WordPress\uff09\u3088\u308a<strong>\u524d<\/strong>\u306b\u8cbc\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u7de8\u96c6\u524d\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u304a\u5fd8\u308c\u306a\u304f\u3002<\/p>';\n\n\t\tif (problems.length) {\n\t\t\thtml += '<h3 class=\"wt-h\">\u5165\u529b\u306e\u78ba\u8a8d<\/h3>';\n\t\t\thtml += W.checks(problems);\n\t\t}\n\n\t\tif (pairs.length) {\n\t\t\thtml += '<h3 class=\"wt-h\">\u751f\u6210\u3057\u305f\u8ee2\u9001\u306e\u4e00\u89a7<\/h3>';\n\t\t\thtml += W.dataTable({\n\t\t\t\tid: 'wt-ht-table',\n\t\t\t\tfilename: 'redirects.csv',\n\t\t\t\trows: pairs.map(function (p) { return { from: p[0], to: p[1] }; }),\n\t\t\t\tcolumns: [\n\t\t\t\t\t{ key: 'from', label: '\u8ee2\u9001\u5143', wrap: true },\n\t\t\t\t\t{ key: 'to', label: '\u8ee2\u9001\u5148', wrap: true }\n\t\t\t\t]\n\t\t\t});\n\t\t}\n\n\t\tresultBox.innerHTML = html;\n\t\tresultBox.hidden = false;\n\n\t\tdocument.getElementById('wt-ht-copy').addEventListener('click', function () {\n\t\t\tW.copy(code, this);\n\t\t});\n\t\tdocument.getElementById('wt-ht-dl').addEventListener('click', function () {\n\t\t\tW.download('.htaccess', code, 'text\/plain;charset=utf-8');\n\t\t});\n\t}\n\n\tdocument.getElementById('wt-ht-run').addEventListener('click', build);\n\troot.querySelector('form').addEventListener('submit', function (e) { e.preventDefault(); build(); });\n})();\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>\u65e7URL\u3068\u65b0URL\u306e\u5bfe\u5fdc\u8868\u3092\u8cbc\u308a\u4ed8\u3051\u308b\u3060\u3051\u3067\u3001.htaccess \u306b\u66f8\u304f301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u8a18\u8ff0\u3092\u751f\u6210\u3057\u307e\u3059\u3002www\u7d71\u4e00\u30fb\u5e38\u6642SSL\u5316\u30fb\u672b\u5c3e\u30b9\u30e9\u30c3\u30b7\u30e5\u7d71\u4e00\u306e\u5b9a\u756a\u30d1\u30bf\u30fc\u30f3\u3082\u30dc\u30bf\u30f3\u3072\u3068\u3064\u3067\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002\u30b5\u30a4\u30c8\u30ea\u30cb\u30e5\u30fc\u30a2\u30eb\u3084\u30c9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"swell_btn_cv_data":"","ssp_meta_description":"\u65e7URL\u3068\u65b0URL\u306e\u5bfe\u5fdc\u8868\u3092\u8cbc\u308b\u3060\u3051\u3067\u3001.htaccess\u306e301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u8a18\u8ff0\u3092\u751f\u6210\u3002www\u7d71\u4e00\u30fb\u5e38\u6642SSL\u5316\u30fb\u672b\u5c3e\u30b9\u30e9\u30c3\u30b7\u30e5\u7d71\u4e00\u306e\u5b9a\u756a\u30d1\u30bf\u30fc\u30f3\u3082\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002\u30b5\u30a4\u30c8\u30ea\u30cb\u30e5\u30fc\u30a2\u30eb\u3084\u30c9\u30e1\u30a4\u30f3\u79fb\u8ee2\u306b\u3002\u30d6\u30e9\u30a6\u30b6\u5185\u3067\u51e6\u7406\u3002","ssp_meta_title":"htaccess\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u751f\u6210\uff5c301\u306e\u66f8\u304d\u65b9\u3092\u7121\u6599\u3067\u4f5c\u6210","ssp_meta_robots":"","ssp_meta_canonical":"","ssp_meta_image":"","ssp_meta_keyword":"","footnotes":""},"class_list":["post-96","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/motoki-design.co.jp\/tools\/wp-json\/wp\/v2\/pages\/96","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/motoki-design.co.jp\/tools\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/motoki-design.co.jp\/tools\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/motoki-design.co.jp\/tools\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/motoki-design.co.jp\/tools\/wp-json\/wp\/v2\/comments?post=96"}],"version-history":[{"count":1,"href":"https:\/\/motoki-design.co.jp\/tools\/wp-json\/wp\/v2\/pages\/96\/revisions"}],"predecessor-version":[{"id":103,"href":"https:\/\/motoki-design.co.jp\/tools\/wp-json\/wp\/v2\/pages\/96\/revisions\/103"}],"wp:attachment":[{"href":"https:\/\/motoki-design.co.jp\/tools\/wp-json\/wp\/v2\/media?parent=96"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}