{"id":4571,"date":"2019-05-31T15:22:26","date_gmt":"2019-05-31T06:22:26","guid":{"rendered":"http:\/\/www.otwo.jp\/blog\/?p=4571"},"modified":"2019-05-31T15:22:26","modified_gmt":"2019-05-31T06:22:26","slug":"use-htaccess","status":"publish","type":"post","link":"https:\/\/www.otwo.jp\/blog\/use-htaccess\/","title":{"rendered":"htaccess\u306e\u57fa\u672c\u77e5\u8b58\u3068\u4f7f\u3044\u65b9\u3010\u521d\u5fc3\u8005\u5411\u3051\u3011"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_main.jpg\" alt=\"\" width=\"700\" height=\"400\" class=\"alignnone size-full wp-image-4653\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_main.jpg 700w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_main-150x86.jpg 150w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_main-300x171.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>\u3053\u3093\u306b\u3061\u306f\u3001WEB\u306e\u4f50\u91ce\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306fWEB\u5236\u4f5c\u3067\u4f7f\u7528\u983b\u5ea6\u304c\u591a\u3044htaccess\u306b\u3064\u3044\u3066\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u4f7f\u7528\u983b\u5ea6\u304c\u9ad8\u3044\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3068\u8a8d\u8a3c\u3084\u3001\u983b\u5ea6\u306f\u4f4e\u3081\u3067\u3059\u304c\u7591\u4f3c\u9759\u7684\u3068\u8a00\u308f\u308c\u308b\u65b9\u6cd5\u306a\u3069\u306e\u8981\u70b9\u3092\u307e\u3068\u3081\u3066\u3001\u30b3\u30d4\u30da\u3067\u4f7f\u3048\u308b\u69d8\u306b\u3057\u3066\u304a\u304f\u306e\u3067\u662f\u975e\u6d3b\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"pageContents\">\n<p class=\"title\">\u3082\u304f\u3058<\/p>\n<dl>\n<dt><a href=\"#step1\">htaccess\u3068\u306f<\/a><\/dt>\n<dt><a href=\"#step2\">htaccess\u306e\u8a2d\u7f6e\u65b9\u6cd5\u3068\u6ce8\u610f\u70b9<\/a><\/dt>\n<dt><a href=\"#step3\">htaccess\u306e\u5229\u7528\u7528\u9014<\/a><\/dt>\n<dd><a href=\"#step3-1\">\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/a><\/dd>\n<dd><a href=\"#step3-2\">\u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c<\/a><\/dd>\n<dd><a href=\"#step3-3\">\u7591\u4f3c\u9759\u7684<\/a><\/dd>\n<dt><a href=\"#step4\">\u307e\u3068\u3081<\/a><\/dt>\n<\/dl>\n<\/div>\n<h1 id=\"step1\">htaccess\u3068\u306f<\/h1>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img1.jpg\" alt=\"\" width=\"700\" height=\"410\" class=\"alignnone size-full wp-image-4655\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img1.jpg 700w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img1-150x88.jpg 150w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img1-300x176.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><br \/>\n\u307e\u305a\u6700\u521d\u306bhtaccess\u306e\u57fa\u672c\u7684\u306a\u5f79\u5272\u3092\u77e5\u3063\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\nhtaccess\u306f\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5358\u4f4d\u3067\u306e\u5236\u5fa1\u304c\u53ef\u80fd\u306aapache\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>htaccess\u3067\u8a2d\u5b9a\u53ef\u80fd\u306a\u3082\u306e\u3092\u53c2\u8003\u307e\u3067\u306b\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<div style=\"font-size:90%; background-color:#EEEEEE; padding:2% 2.5%; border-radius:10px; line-height:1.8em;\">\n\u30fb\u30da\u30fc\u30b8\u306e\u30a2\u30af\u30bb\u30b9\u3092\u5236\u9650(404\u3084403\u306a\u3069)<br \/>\n\u30fb\u30da\u30fc\u30b8\u306e\u30a2\u30af\u30bb\u30b9\u306b\u8a8d\u8a3c\u3092\u8a2d\u3051\u308b<br \/>\n\u30fb\u30da\u30fc\u30b8\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<br \/>\n\u30fbPHP\u306e\u8a2d\u5b9a\u5909\u66f4<br \/>\n\u30fb\u30d5\u30a1\u30a4\u30eb\u7b49\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u8a2d\u5b9a\n<\/div>\n<h1 id=\"step2\">htaccess\u306e\u8a2d\u7f6e\u65b9\u6cd5\u3068\u6ce8\u610f\u70b9<\/h1>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img2.jpg\" alt=\"\" width=\"700\" height=\"410\" class=\"alignnone size-full wp-image-4656\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img2.jpg 700w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img2-150x88.jpg 150w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img2-300x176.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><br \/>\nhtaccess\u306f\u8a2d\u7f6e\u304c\u7c21\u5358\u3067\u3001\u304b\u3064\u30b5\u30fc\u30d0\u30fc\u306e\u518d\u8d77\u52d5\u3082\u4e0d\u8981\u306a\u3001\u3068\u3066\u3082\u4fbf\u5229\u306a\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n<h2 id=\"step2-1\">\u8a2d\u7f6e\u65b9\u6cd5<\/h2>\n<p>\u300c.htaccess\u300d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u5148\u982d\u306b.(\u30c9\u30c3\u30c8)\u3092\u4ed8\u3051\u308b\u4e8b\u3067\u96a0\u3057\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nPC\u306e\u8a2d\u5b9a\u306b\u3088\u3063\u3066\u306f\u96a0\u3057\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u51fa\u6765\u306a\u3044\u5834\u5408\u3082\u3042\u308b\u306e\u3067\u3001\u5404\u81ea\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u4f5c\u6210\u65b9\u6cd5\u3092\u8abf\u3079\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u5c0f\u30cd\u30bf\u3068\u3057\u3066\u306f\u300c.htaccess.\u300d\u3067\u4f5c\u6210\u3059\u308b\u3068\u3001\u6700\u5f8c\u306e\u30c9\u30c3\u30c8\u304c\u6d88\u3048\u3066\u624b\u8efd\u306b\u4f5c\u308c\u308b\u306e\u3067\u79c1\u306f\u666e\u6bb5\u3053\u306e\u65b9\u6cd5\u3067\u4f5c\u3063\u3066\u307e\u3059\u3002<\/p>\n<p>\u4f5c\u6210\u30d5\u30a1\u30a4\u30eb\u306fWEB\u30b5\u30fc\u30d0\u30fc\u306e\u5236\u5fa1\u3057\u305f\u3044\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u76f4\u4e0b\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n<h2 id=\"step2-2\">\u6ce8\u610f\u70b9<\/h2>\n<p>htaccess\u306f\u8a2d\u5b9a\u306e\u4e0a\u66f8\u304d\u30d5\u30a1\u30a4\u30eb\u3060\u3068\u8a00\u3046\u4e8b\u3092\u899a\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u666e\u6bb5\u304b\u3089PHP\u3092\u4f7f\u3063\u3066\u3044\u308b\u4eba\u3084\u3001apache\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u4eba\u306a\u3089\u30a4\u30e1\u30fc\u30b8\u3057\u3084\u3059\u3044\u306e\u3067\u3059\u304c\u3001htaccess\u3067\u51fa\u6765\u308b\u5236\u5fa1\u306f\u5225\u306e\u65b9\u6cd5\u3067\u3082\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002<br \/>\nPHP\u304c\u52d5\u304fapache\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u3068php.ini\u3084httpd.conf\u3068\u8a00\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3001\u3053\u308c\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3082\u540c\u69d8\u306e\u5236\u5fa1\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306a\u3069\u306e\u51e6\u7406\u3092\u8272\u3005\u306a\u5834\u6240\u306b\u66f8\u3044\u3066\u3057\u307e\u3046\u3068\u3001\u5f8c\u306e\u30c8\u30e9\u30d6\u30eb\u306b\u3064\u306a\u304c\u308b\u53ef\u80fd\u6027\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u53c2\u7167\u3059\u308b\u512a\u5148\u5ea6\u306f\u4ee5\u4e0b\u306e\u9806\u756a\u306b\u306a\u308b\u306e\u3067\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u30eb\u30fc\u30eb\u3092\u6c7a\u3081\u3066\u904b\u7528\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\nphp.ini &lt; httpd.conf &lt; .htaccess &lt; php_ini(PHP\u306e\u95a2\u6570)<\/p>\n<h1 id=\"step3\">htaccess\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046<\/h1>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img3.jpg\" alt=\"\" width=\"700\" height=\"410\" class=\"alignnone size-full wp-image-4652\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img3.jpg 700w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img3-150x88.jpg 150w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/05\/htaccess_img3-300x176.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><br \/>\n\u65e9\u901fhtaccess\u3092\u4f7f\u3063\u305f\u3001\u3044\u304f\u3064\u304b\u306e\u51e6\u7406\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<br \/>\n\u4eca\u56de\u306f\u4ee5\u4e0b\u306e3\u3064\u3092\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30fb\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<br \/>\n\u30fb\u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c<br \/>\n\u30fb\u7591\u4f3c\u9759\u7684URL<\/p>\n<h2 id=\"step3-1\">\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/h2>\n<p>\u4e3b\u306a\u4f7f\u7528\u5834\u9762\u306f\u4ee5\u4e0b\u306e\u3082\u306e\u3002<\/p>\n<div style=\"font-size:90%; background-color:#EEEEEE; padding:2% 2.5%; border-radius:10px; line-height:1.8em;\">\n\u30fb\u30b5\u30a4\u30c8\u306e\u5f15\u3063\u8d8a\u3057<br \/>\n\u30fb\u30c6\u30a3\u30b6\u30fc\u30da\u30fc\u30b8\u306a\u3069\u4e00\u6b21\u7684\u306a\u753b\u9762\u3078\u306e\u8a98\u5c0e<br \/>\n\u30fbURL\u306e\u6b63\u898f\u5316(https\u3084www\u3078\u306e\u7d71\u4e00)\n<\/div>\n<p>\u7279\u5b9a\u306e\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u305f\u6642\u306b\u3001\u5225\u306e\u30da\u30fc\u30b8\u306b\u9077\u79fb\u3055\u305b\u308b\u65b9\u6cd5\u3067\u3059\u3002<br \/>\n\u25a0htaccess<br \/>\n\u4f8b\uff09http\/index.html\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\/index2.html\u3078\u9077\u79fb\u3055\u305b\u308b\u65b9\u6cd5<\/p>\n<pre class=\"brush: python\r; notranslate\">#URL\u66f8\u304d\u63db\u3048\u3092\u53ef\u80fd\u306b\u3059\u308b\r\nRewriteEngine on\r\n\r\n#URL\u306e\u66f8\u304d\u63db\u3048\u30eb\u30fc\u30eb\u3092\u8a18\u8ff0\u3059\u308b index \u2192 index2\r\nRewriteRule ^index.html$ https:\/\/\u25cf\u25cf\u25cf\u25cf\u25cf\/index2.html [R=302,L]\r\n<\/pre>\n<p>\u25cf\u306b\u306f\u30c9\u30e1\u30a4\u30f3\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u307e\u305f\u3001\u9077\u79fb\u5148\u306eURL\u306f&#8221;http&#8221;\u3082\u3057\u304f\u306f&#8221;https&#8221;\u3067\u59cb\u307e\u308b\u7d76\u5bfeURL\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307e\u305f\u3001RewriteRule\u306e\u6700\u5f8c\u306b\u3064\u3044\u3066\u3044\u308b[]\u5185\u306e\u6307\u5b9a\u306f\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n&#8220;L&#8221;\u306f\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u30eb\u30fc\u30eb\u306b\u8a72\u5f53\u3057\u305f\u5834\u5408\u306b\u4ee5\u964d\u306e\u30eb\u30fc\u30eb\u3092\u7121\u8996\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<p>&#8220;R&#8221;\u306b\u306f301(\u6052\u4e45\u7684)\u3084302(\u4e00\u6642\u7684)\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u30fb\u30b5\u30a4\u30c8\u306e\u5f15\u3063\u8d8a\u3057\u306a\u3069\u306f301<br \/>\n\u30fb\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u753b\u9762\u3078\u306e\u8a98\u5c0e\u306a\u3069\u306f302<br \/>\n\u7528\u9014\u306b\u5fdc\u3058\u3066\u9069\u5207\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>URL\u3092www\u6709\u308a\u306b\u7d71\u4e00<\/h3>\n<p>URL\u306bwww\u306b\u3064\u3051\u308b\u6b63\u898f\u5316\u3092\u66f8\u3044\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<div style=\"font-size:90%; background-color:#EEEEEE; padding:2% 2.5%; border-radius:10px; line-height:1.8em;\">\nhttps:\/\/otwo.jp\/\u306e\u30a2\u30af\u30bb\u30b9\u3092<br \/>\n\u2193<br \/>\nhttps:\/\/www.otwo.jp\/\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\n<\/div>\n<pre class=\"brush: python\r; notranslate\">RewriteEngine On\r\n#\u30db\u30b9\u30c8\u540d\u306bwww\u304c\u4ed8\u3044\u3066\u3044\u306a\u3051\u308c\u3070\u3001\u6b21\u884c\u306e\u30eb\u30fc\u30eb\u3092\u9069\u7528\r\nRewriteCond %{HTTP_HOST} ^otwo.jp\r\nRewriteRule (.*) https:\/\/www.otwo.jp\/$1 [R=301,L]\r\n<\/pre>\n<p>\u3053\u306e\u5834\u5408\u300chttp:\/\/www.otwo.jp\u300d\u3067\u306e\u30a2\u30af\u30bb\u30b9\u6642\u306fwww\u304c\u4ed8\u3044\u3066\u3044\u308b\u306e\u3067\u30013\u884c\u540d\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306f\u51e6\u7406\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<h3>URL\u3092http\u304b\u3089https\u306b\u7d71\u4e00<\/h3>\n<p>\u3053\u3061\u3089\u3082\u3088\u304f\u4f7f\u3046\u306e\u3067\u3042\u308f\u305b\u3066\u7d39\u4ecb\u3057\u3066\u304a\u304d\u307e\u3059\u3002<br \/>\nhttp\u3067\u306e\u30a2\u30af\u30bb\u30b9\u3092https\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u8a18\u8ff0\u3067\u3059\u3002<\/p>\n<div style=\"font-size:90%; background-color:#EEEEEE; padding:2% 2.5%; border-radius:10px; line-height:1.8em;\">\nhttp:\/\/www.otwo.jp\/\u306e\u30a2\u30af\u30bb\u30b9\u3092<br \/>\n\u2193<br \/>\nhttps:\/\/www.otwo.jp\/\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\n<\/div>\n<pre class=\"brush: python\r; notranslate\">RewriteEngine On\r\n#https\u3067\u306f\u306a\u3044\u5834\u5408\u3001\u6b21\u884c\u306e\u30eb\u30fc\u30eb\u3092\u9069\u7528\r\nRewriteCond %{HTTPS} off\r\nRewriteRule ^(.*)$ https:\/\/www.otwo.jp\/$1\r\n<\/pre>\n<p>\u3053\u306e\u5834\u5408\u300chttps:\/\/www.otwo.jp\u300d\u3067\u306e\u30a2\u30af\u30bb\u30b9\u6642\u306fhttps\u3067\u306e\u30a2\u30af\u30bb\u30b9\u306a\u306e\u3067\u30013\u884c\u540d\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306f\u51e6\u7406\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<h2 id=\"step3-2\">\u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c<\/h2>\n<p>\u4e3b\u306a\u4f7f\u7528\u5834\u9762\u306f\u4ee5\u4e0b\u306e\u3082\u306e\u3002<\/p>\n<div style=\"font-size:90%; background-color:#EEEEEE; padding:2% 2.5%; border-radius:10px; line-height:1.8em;\">\n\u30fb\u958b\u767a\u74b0\u5883\u3078\u306e\u30a2\u30af\u30bb\u30b9\u5236\u9650<br \/>\n\u30fb\u9650\u5b9a\u3057\u305f\u4eba\u3057\u304b\u4f7f\u7528\u3057\u306a\u3044\u30b7\u30b9\u30c6\u30e0\u306e\u30a2\u30af\u30bb\u30b9\u5236\u9650\n<\/div>\n<p>WEB\u3067\u958b\u767a\u3059\u308b\u5834\u5408\u306b\u3001\u4e00\u822c\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u304c\u306a\u3044\u69d8\u306b\u30af\u30ed\u30fc\u30eb\u3092\u62d2\u5426\u3059\u308b\u306a\u3069\u306e\u6839\u672c\u7684\u306a\u5bfe\u7b56\u3082\u5fc5\u8981\u3067\u3059\u304c\u3001\u76f4URL\u306a\u3069\u306e\u5bfe\u7b56\u3067\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n\u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c\u3092\u884c\u3046\u969b\u306b\u306f.httaccess\u3068\u4f75\u305b\u3066\u3001.htpasswd\u306e\u30d5\u30a1\u30a4\u30eb\u3082\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n.htpasswd\u306f\u30a2\u30af\u30bb\u30b9\u306b\u5fc5\u8981\u306a\u30e6\u30fc\u30b6ID\u3084\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a18\u8ff0\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u25a0htaccess<\/p>\n<pre class=\"brush: python\r; notranslate\">#\u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c\r\nAuthUserFile \u2605\u30d5\u30eb\u30d1\u30b9\u3092\u8a18\u8ff0\u2605.htpasswd\r\nAuthName \"Member Only\"\r\nAuthType Basic\r\nrequire valid-user\r\n<\/pre>\n<p>\u2605\u3067\u56f2\u3093\u3060\u5834\u6240\u306b\u306f.htpasswd\u3092\u8a2d\u7f6e\u3057\u3066\u3044\u308b\u5834\u6240\u3092\u30d5\u30eb\u30d1\u30b9\u3067\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u30d5\u30eb\u30d1\u30b9\u304c\u308f\u304b\u3089\u306a\u3044\u4eba\u306f\u4e0b\u8a18\u306e\u624b\u9806\u3067\u8abf\u3079\u308c\u308b\u306e\u3067\u8a66\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div style=\"font-size:90%; background-color:#EEEEEE; padding:2% 2.5%; border-radius:10px; line-height:1.8em;\">\n1.PC\u3067\u65b0\u898f\u306e\u30e1\u30e2\u5e33\u3092\u7acb\u3061\u4e0a\u3052\u308b<br \/>\n2.\u30e1\u30e2\u5e33\u306b\u4e0b\u8a18\u3092\u8a18\u8ff0\u3059\u308b<br \/>\n\u3000&lt;?php print __FILE__; ?&gt;<br \/>\n3.\u30d5\u30a1\u30a4\u30eb\u306e\u62e1\u5f35\u5b50\u3092php\u306b\u3057\u3066\u4fdd\u5b58\u3059\u308b(fullpath.php\u3068\u304b)<br \/>\n4.\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092htpasswd\u3068\u540c\u968e\u5c64\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\n<\/div>\n<p>\u3042\u3068\u306f\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u30d5\u30eb\u30d1\u30b9\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u3067htaccess\u306b\u30b3\u30d4\u30da\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u4f5c\u696d\u5f8c\u306f\u30d5\u30eb\u30d1\u30b9\u8abf\u67fb\u7528\u306b\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u524a\u9664\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>AuthName\u306f\u8a8d\u8a3c\u3092\u4fc3\u3059\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u969b\u306b\u8868\u793a\u3055\u308c\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u306a\u308b\u306e\u3067\u9069\u5f53\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u25a0htpasswd<br \/>\n\u4e0b\u8a18\u306fID\u3001PW\u3068\u3082\u306b&#8221;test&#8221;\u3067\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u4f8b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python\r; notranslate\">test:hg.iKlWr6lAZ6\r\n<\/pre>\n<p>htpasswd\u306b\u306f\u300c\u30e6\u30fc\u30b6\u540d\u300d:\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u300d\u306e\u66f8\u5f0f\u3067\u8a18\u8ff0\u3057\u307e\u3059\u3002<br \/>\n\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u6697\u53f7\u5316\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u300c\u30d9\u30fc\u30b7\u30c3\u30af\u8a8d\u8a3c\u3000\u30d1\u30b9\u30ef\u30fc\u30c9\u300d\u306a\u3069\u306e\u691c\u7d22\u3067\u30d2\u30c3\u30c8\u3059\u308b\u30b5\u30a4\u30c8\u3092\u4f7f\u3063\u3066\u751f\u6210\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n\u8907\u6570\u306e\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f\u3001\u884c\u3092\u5909\u3048\u3066\u8ffd\u8a18\u3059\u308b\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n<h2 id=\"step3-3\">\u7591\u4f3c\u9759\u7684<\/h2>\n<p>\u30d6\u30ed\u30b0\u3084\u30b7\u30e7\u30c3\u30d4\u30f3\u30b0\u30b5\u30a4\u30c8\u306e\u69d8\u306b\u30da\u30fc\u30b8\u6570\u304c\u591a\u3044\u52d5\u7684\u30b5\u30a4\u30c8\u306eURL\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4ed8\u3051\u305f\u304f\u306a\u3044\u6642\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u5229\u7528\u983b\u5ea6\u3068\u3057\u3066\u306f\u5c11\u306a\u305d\u3046\u3067\u3059\u304c\u3001WEB\u5236\u4f5c\u306e\u77e5\u8b58\u3068\u3057\u3066\u77e5\u3063\u3066\u3044\u3066\u3082\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u7591\u4f3c\u9759\u7684\u306e\u5177\u4f53\u7684\u306a\u52d5\u304d\u3067\u3059\u304c\u4ee5\u4e0b\u306e\u69d8\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<div style=\"font-size:90%; background-color:#EEEEEE; padding:2% 2.5%; border-radius:10px; line-height:1.8em;\">\nhttps:\/\/testdomain\/category\/test\/\u3067\u30a2\u30af\u30bb\u30b9\u3055\u308c\u308b\u3002<br \/>\n\u2193<br \/>\nhttps:\/\/testdomain\/index.html?category=test\u3067\u30a2\u30af\u30bb\u30b9\u3055\u308c\u305f\u69d8\u306b\u5185\u90e8\u7684\u306b\u306f\u51e6\u7406\u3059\u308b\u3002\n<\/div>\n<p>\u3053\u306e\u69d8\u306b\u5185\u90e8\u7684\u306b\u52d5\u7684\u30da\u30fc\u30b8\u3067\u3082\u3001\u9759\u7684\u30da\u30fc\u30b8\u306e\u69d8\u306aURL\u3067\u898b\u305b\u308b\u4e8b\u3092\u7591\u4f3c\u9759\u7684\u3068\u547c\u3093\u3060\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u25a0htaccess<\/p>\n<pre class=\"brush: python\r; notranslate\">RewriteEngine on\r\nRewriteRule ^([0-1a-z]*)$ index.php?category=$1\r\n<\/pre>\n<p>2\u884c\u76ee\u306e()\u3067\u56f2\u3063\u305f\u7bc4\u56f2\u306e\u6587\u5b57\u5217\u304c$1\u306b\u4ee3\u5165\u3055\u308c\u307e\u3059\u3002<br \/>\n\u9077\u79fb\u5143\u306e()\u3092\u5897\u3084\u3059\u3053\u3068\u3067$2\u3001$3\u3068\u8a00\u3063\u305f\u5177\u5408\u306b\u5909\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f()\u5185\u306b\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u82f1\u6570\u5c0f\u6587\u5b57\u3068\u6570\u5b57\u3092\u4f7f\u3063\u305fURL\u3067\u3042\u308c\u3070GET\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u51e6\u7406\u3055\u308c\u308b\u69d8\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u7591\u4f3c\u9759\u7684\u306f\u3001\u5c11\u3057\u524d\u306b\u9759\u7684URL\u306e\u65b9\u304cSEO\u306b\u9069\u3057\u3066\u3044\u308b\u3068\u8a00\u3046\u4e8b\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u305f\u305d\u3046\u3067\u3059\u304c\u3001\u73fe\u5728\u306f\u52d5\u7684\u3067\u3082\u9759\u7684\u3067\u3082SEO\u306e\u5dee\u304c\u306a\u3044\u3068\u8a00\u308f\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u597d\u307f\u3067\u4f7f\u3044\u5206\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2 id=\"step4\">\u307e\u3068\u3081<\/h2>\n<p>htaccess\u306f\u30b3\u30d4\u30da\u3067\u4f7f\u3044\u56de\u3059\u4e8b\u304c\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u7591\u4f3c\u9759\u7684\u306a\u3069\u5c11\u3057\u77e5\u8b58\u304c\u5fc5\u8981\u306a\u4f7f\u3044\u65b9\u306a\u3093\u304b\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\n\u306a\u304b\u306a\u304b\u77e5\u8b58\u3092\u6df1\u5800\u3059\u308b\u6a5f\u4f1a\u3082\u5c11\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u8a18\u4e8b\u304c\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<br \/>\n\u79c1\u3082\u6b63\u898f\u8868\u73fe\u3068\u304b\u82e6\u624b\u610f\u8b58\u304c\u3042\u308b\u306e\u3067\u514b\u670d\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\uff01<\/p>\n<p>\u3067\u306f\u307e\u305f\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001WEB\u306e\u4f50\u91ce\u3067\u3059\u3002 \u4eca\u56de\u306fWEB\u5236\u4f5c\u3067\u4f7f\u7528\u983b\u5ea6\u304c\u591a\u3044htaccess\u306b\u3064\u3044\u3066\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u3053\u3053\u3067\u306f\u4f7f\u7528\u983b\u5ea6\u304c\u9ad8\u3044\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3068\u8a8d\u8a3c\u3084\u3001\u983b\u5ea6\u306f\u4f4e\u3081\u3067\u3059\u304c\u7591\u4f3c\u9759\u7684\u3068\u8a00\u308f\u308c\u308b\u65b9\u6cd5\u306a\u3069\u306e\u8981\u70b9\u3092\u307e\u3068\u3081\u3066 [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":4654,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[83,134],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/4571"}],"collection":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/comments?post=4571"}],"version-history":[{"count":45,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/4571\/revisions"}],"predecessor-version":[{"id":4674,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/4571\/revisions\/4674"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/media\/4654"}],"wp:attachment":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/media?parent=4571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/categories?post=4571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/tags?post=4571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}