{"id":1018,"date":"2011-09-08T21:38:04","date_gmt":"2011-09-08T12:38:04","guid":{"rendered":"http:\/\/blog.rutake.com\/techmemo\/?p=1018"},"modified":"2011-09-08T21:38:04","modified_gmt":"2011-09-08T12:38:04","slug":"php5-htaccess%e3%81%ab%e3%82%88%e3%82%8bbasic%e8%aa%8d%e8%a8%bc%e3%81%ae%e3%81%a8%e3%81%8d%e3%81%ae%e3%83%a6%e3%83%bc%e3%82%b6%e5%90%8d%e5%8f%96%e5%be%97%e3%81%ab%e3%81%af_serverremote_user","status":"publish","type":"post","link":"https:\/\/blog.rutake.com\/techmemo\/2011\/09\/08\/php5-htaccess%e3%81%ab%e3%82%88%e3%82%8bbasic%e8%aa%8d%e8%a8%bc%e3%81%ae%e3%81%a8%e3%81%8d%e3%81%ae%e3%83%a6%e3%83%bc%e3%82%b6%e5%90%8d%e5%8f%96%e5%be%97%e3%81%ab%e3%81%af_serverremote_user\/","title":{"rendered":"PHP5 .htaccess\u306b\u3088\u308bBASIC\u8a8d\u8a3c\u306e\u3068\u304d\u306e\u30e6\u30fc\u30b6\u540d\u53d6\u5f97\u306b\u306f$_SERVER[&#8216;REMOTE_USER&#8217;]\u3092\u4f7f\u3046"},"content":{"rendered":"<p>\u3046\u30fc\u3093\u30b5\u30fc\u30d0\u79fb\u884c\u3067\u306f\u307e\u3063\u305f\u3002<\/p>\n<p>\u4ee5\u524d\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306fBASIC\u8a8d\u8a3c\u304c\u884c\u308f\u308c\u3066\u3044\u306a\u3044\u3068\u3001\u8a8d\u8a3c\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3057\u3066\u30b5\u30a4\u30c9\u30a2\u30af\u30bb\u30b9\u3092\u8981\u6c42\u3059\u308b\u3064\u304f\u308a\u306b\u306a\u3063\u3066\u3044\u305f\u3002\u30b5\u30fc\u30d0\u304c\u5909\u308f\u3063\u3066\u3082\u3053\u3093\u306a\u5358\u7d14\u306a\u3082\u306e\u3059\u3050\u52d5\u304f\u3060\u308d\u3046\u3068\u601d\u3063\u305f\u304c\u3001\u4f55\u5ea6\u3084\u3063\u3066\u3082\u8a8d\u8a3c\u306b\u30d1\u30b9\u3057\u306a\u3044\u3002<\/p>\n<p>[php]<br \/>\nif (!isset($_SERVER[&#8216;PHP_AUTH_USER&#8217;])) {<br \/>\n    header(&#8220;WWW-Authenticate: Basic realm=\\&#8221;INPUT ID AND PASSWORD\\&#8221;&#8221;);<br \/>\n    header(&#8220;HTTP\/1.0 401 Unauthorized&#8221;);<br \/>\n    exit;<br \/>\n}<br \/>\n[\/php]<\/p>\n<p>\u8abf\u3079\u3066\u307f\u308b\u3068PHP_AUTH_USER\u304c\u7a7a\u767d\u3068\u306a\u308a\u53d6\u5f97\u3067\u304d\u3066\u3044\u306a\u3044\u3002<br \/>\n\u306a\u3093\u3067\uff01\uff01\u3068\u8abf\u3079\u3066\u307f\u305f\u3068\u3053\u308d\u3053\u306e\u30b5\u30fc\u30d0\u79fb\u884c\u5148\u3067\u306f\u8af8\u6240\u306e\u4e8b\u60c5\u306b\u3088\u308a.htaccess\u306b\u3088\u308b\u8a8d\u8a3c\u3092\u304b\u3051\u3066\u3044\u305f\u3002\u305d\u306e\u5834\u5408\u306fREMOTE_USER\u3068\u3044\u3046\u3082\u306e\u3067\u53d6\u5f97\u3067\u304d\u308b\u305d\u3046\u306a\u3002<\/p>\n<p>[php]<br \/>\necho $_SERVER[&#8216;PHP_AUTH_USER&#8217;];<br \/>\necho $_SERVER[&#8216;REMOTE_USER&#8217;];<br \/>\n[\/php]<\/p>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u8a66\u3057\u3066\u307f\u305f\u3089\u3001\u78ba\u304b\u306b\u4e0b\u6bb5\u306e\u8a18\u8ff0\u3067\u30e6\u30fc\u30b6\u540d\u3092\u53d6\u5f97\u53ef\u80fd\u306a\u306e\u3067\u3042\u3063\u305f\uff01\u7d30\u304b\u3044\u9055\u3044\u306b\u3073\u3063\u304f\u308a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3046\u30fc\u3093\u30b5\u30fc\u30d0\u79fb\u884c\u3067\u306f\u307e\u3063\u305f\u3002 \u4ee5\u524d\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306fBASIC\u8a8d\u8a3c\u304c\u884c\u308f\u308c\u3066\u3044\u306a\u3044 &hellip; <a href=\"https:\/\/blog.rutake.com\/techmemo\/2011\/09\/08\/php5-htaccess%e3%81%ab%e3%82%88%e3%82%8bbasic%e8%aa%8d%e8%a8%bc%e3%81%ae%e3%81%a8%e3%81%8d%e3%81%ae%e3%83%a6%e3%83%bc%e3%82%b6%e5%90%8d%e5%8f%96%e5%be%97%e3%81%ab%e3%81%af_serverremote_user\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,16],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/1018"}],"collection":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/comments?post=1018"}],"version-history":[{"count":1,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/1018\/revisions"}],"predecessor-version":[{"id":1019,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/1018\/revisions\/1019"}],"wp:attachment":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/media?parent=1018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/categories?post=1018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/tags?post=1018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}