{"id":3017,"date":"2012-06-03T16:07:37","date_gmt":"2012-06-03T07:07:37","guid":{"rendered":"http:\/\/nanoappli.com\/blog\/?p=3017"},"modified":"2012-06-03T17:50:58","modified_gmt":"2012-06-03T08:50:58","slug":"htaccess%e3%81%a7rewriterule%e4%bd%bf%e7%94%a8%e6%99%82%e3%82%a2%e3%83%89%e3%83%ac%e3%82%b9%e3%83%90%e3%83%bc%e3%81%aeurl%e8%a1%a8%e7%a4%ba%e3%82%92%e5%a4%89%e6%9b%b4%e3%81%95%e3%81%9b%e3%81%aa","status":"publish","type":"post","link":"http:\/\/nanoappli.com\/blog\/archives\/3017","title":{"rendered":".htaccess\u3067RewriteRule\u4f7f\u7528\u6642,\u30a2\u30c9\u30ec\u30b9\u30d0\u30fc\u306eURL\u8868\u793a\u3092\u5909\u66f4\u3055\u305b\u306a\u3044"},"content":{"rendered":"<p>\nRewriteRule\u306e\u5b9a\u7fa9\u3092.htaccess\u306b\u884c\u3063\u305f\u969b\u3001\u8a2d\u5b9a\u306b\u3088\u3063\u3066\u3001\u30d6\u30e9\u30a6\u30b6\u306eURL\u6b04\u304c\u66f8\u304d\u63db\u308f\u3063\u305f\u308a\u3001\u63db\u308f\u3089\u306a\u304b\u3063\u305f\u308a\u3057\u305f\u306e\u3067\u3001\u305d\u306e\u8fba\u306e\u4ed5\u69d8\u3092\u6539\u3081\u3066\u8abf\u3079\u305f\u7d50\u679c\u306e\u30e1\u30e2\u3067\u3059\u3002<br \/>\n<br \/>\n<br \/>\n<h2>URL\u66f8\u304d\u63db\u3048\u306e\u57fa\u672c<\/h2>\n<br \/>\n.htaccess\u3067RewriteRule\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u6307\u5b9a\u3055\u308c\u305fURL\u3092\u66f8\u304d\u63db\u3048\u308b\u4e8b\u304c\u51fa\u6765\u308b\u3002<br \/>\n<br \/>\n<br \/>\n\u4f8b\u3048\u3070\u3001\u4e0b\u8a18\u306e\u30eb\u30fc\u30eb\u306f\u3001\u4efb\u610f\u306eURL\u6307\u5b9a\u306b\u5bfe\u3057\u3066\u3082\u3001Yahoo\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u3002<br \/>\n\u3053\u306e\u66f8\u304d\u63db\u3048\u30eb\u30fc\u30eb\u306f\u3001.htaccess\u304c\u5b58\u5728\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306eURL\u306b\u5bfe\u3057\u3066\u9069\u7528\u3055\u308c\u308b\u3002<br \/>\n<pre lang=\"x\">\nRewriteRule ^.*$ http:\/\/www.yahoo.co.jp\/\n<\/pre>\n\u3053\u306e\u969b\u306e\u30a2\u30c9\u30ec\u30b9\u30d0\u30fc\u8868\u793a\u306f\u3001http:\/\/www.yahoo.co.jp\/\u306b\u306a\u308b\u3002<br \/>\n<br \/>\n<br \/>\n<br \/>\n\u3053\u308c\u304c\u4ee5\u4e0b\u306e\u30eb\u30fc\u30eb\u306e\u5834\u5408\u3001\u30a2\u30c9\u30ec\u30b9\u30d0\u30fc\u306e\u8868\u793a\u306f\u5909\u66f4\u3055\u308c\u306a\u3044<br \/>\n<pre lang=\"x\">\nRewriteRule ^.*$ lib\/contoller.php\n<\/pre>\n\u7d50\u679c\u3068\u3057\u3066\u3001\u30d6\u30e9\u30a6\u30b6\u5074\u304b\u3089\u3059\u308b\u3068URL\u306e\u30ea\u30e9\u30a4\u30c8\u304c\u884c\u308f\u308c\u305f\u4e8b\u3092\u691c\u51fa\u3067\u304d\u306a\u3044\u3002<br \/>\n\u3053\u308c\u3092forward(\u3082\u3057\u304f\u306finternal redirect)\u3068\u547c\u3076\u3002<br \/>\n<br \/>\n<br \/>\n<br \/>\n\u3057\u304b\u3057\u3001Rewrite\u5f8c\u306eURL\u3092\u30c9\u30e1\u30a4\u30f3\u540d\u4ed8\u304d\u3067\u5b9a\u7fa9\u3057\u305f\u5834\u5408\u306f\u3001redirect(\u3082\u3057\u304f\u306fexternal redirect)\u3068\u306a\u308b\u3002<br \/>\n<pre lang=\"x\">\nRewriteRule ^.*$ http:\/\/my.domain.com\/lib\/contoller.php\n<\/pre>\n\u30a2\u30c9\u30ec\u30b9\u30d0\u30fc\u8868\u793a\u3082\u3001\u66f8\u304d\u63db\u3048\u5f8c\u306eURL\u306b\u306a\u308b\u3002<br \/>\n\u3053\u306e\u3068\u304d\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u30d6\u30e9\u30a6\u30b6\u306f\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u304c\u884c\u308f\u308c\u305f\u4e8b\u3092\u691c\u51fa\u3067\u304d\u308b\u3002<br \/>\n<br \/>\n\u5b9f\u969b\u306b\u306f\u4e00\u65e6Status=302:Found\u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u8fd4\u3055\u308c\u3001Location\u30d8\u30c3\u30c0\u306bhttp:\/\/my.domain.com\/lib\/contoller.php\u304c\u6307\u5b9a\u3055\u308c\u308b(firebug\u3067\u78ba\u8a8d)\u3002\u305d\u306e\u5f8c\u30d6\u30e9\u30a6\u30b6\u306f\u3001302\u30ec\u30b9\u30dd\u30f3\u30b9\u30b3\u30fc\u30c9\u53d7\u4fe1\u6642\u306e\u4ed5\u69d8\u306b\u5f93\u3044\u3001\u6539\u3081\u3066http:\/\/my.domain.com\/lib\/contoller.php\u3078\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u6295\u3052\u308b\u4e8b\u306b\u306a\u308b\u3002<br \/>\n<br \/>\n\u3053\u306e\u632f\u308b\u821e\u3044\u306f\u3001\u305f\u3068\u3048RewriteRule\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308bmy.domain.com\u304c\u3001\u6700\u521d\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u3042\u3063\u305f\u30b5\u30fc\u30d0\u3068\u540c\u3058\u3067\u3042\u3063\u3066\u3082\u884c\u308f\u308c\u308b(apache\u304b\u3089\u3059\u308b\u3068\u3001my.domain.com\u304c\u81ea\u5206\u3067\u3042\u308b\u4e8b\u3092\u78ba\u8a8d\u3067\u304d\u306a\u3044\u305f\u3081??)\u3002<br \/>\n<br \/>\n<br \/>\n<br \/>\n<br \/>\n\u307e\u305f\u3001URL\u306b\u30c9\u30e1\u30a4\u30f3\u3092\u660e\u8a18\u3057\u306a\u304f\u3066\u3082\u3001external redirect\u3092\u660e\u793a\u3059\u308b\u4e8b\u306f\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u308b\u3002<br \/>\n\u4e0b\u8a18\u306e\u4f8b\u306e\u3088\u3046\u306b\u3001\u5909\u66f4\u5f8cURL\u306e\u5f8c\u308d\u306bR=301\u3068\u8868\u8a18\u3059\u308b\u4e8b\u3067\u3001\u660e\u793a\u7684\u306b301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u884c\u308f\u305b\u308b\u4e8b\u304c\u51fa\u6765\u308b\u3002\u3082\u3061\u308d\u3093R=302\u3068\u3059\u308c\u3070\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9=302\u306e\u3068\u304d\u306e\u632f\u308b\u821e\u3044\u306b\u306a\u308b\u3057\u3001R=404\u3067NotFound\u306b\u3055\u305b\u308b\u3053\u3068\u3082\u53ef\u80fd\u3002<br \/>\n<pre lang=\"x\">\nRewriteRule ^.*$ http:\/\/my.domain.com\/lib\/contoller.php [R=301]\n<\/pre>\n<br \/>\n<br \/>\n<br \/>\n<br \/>\n<h2>\u305d\u306e\u4ed6\u306e\u30aa\u30d7\u30b7\u30e7\u30f3<\/h2>\nRewriteRule\u66f8\u304d\u63db\u3048\u5f8c\u306eURL\u304c\u3001\u518d\u5ea6\u30eb\u30fc\u30eb\u306b\u30de\u30c3\u30c1\u3059\u308b\u3068\u304d\u3001\u7121\u9650\u30eb\u30fc\u30d7\u306b\u9665\u3063\u3066\u3057\u307e\u3046\u3002<br \/>\n\u3053\u308c\u3092\u9632\u3050\u306b\u306f\u30eb\u30fc\u30eb\u306e\u672b\u5c3e\u306b[L]\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5b9a\u7fa9\u3059\u308b\u3002<br \/>\n<br \/>\n<br \/>\n<a href=\"http:\/\/www.amazon.co.jp\/exec\/obidos\/ASIN\/4873113814\/nanoappli-22\/\" target=\"_blank\"><img src=\"http:\/\/ec2.images-amazon.com\/images\/I\/515t-Vj3AAL._SL160_.jpg\" alt=\"4873113814\" border=\"0\" \/><\/a><br \/>\n<a href=\"http:\/\/www.amazon.co.jp\/exec\/obidos\/ASIN\/4873113814\/nanoappli-22\/\" target=\"_blank\">Apache\u30af\u30c3\u30af\u30d6\u30c3\u30af \u7b2c2\u7248 \u2015Web\u30b5\u30fc\u30d0\u7ba1\u7406\u8005\u306e\u305f\u3081\u306e\u30ec\u30b7\u30d4\u96c6 <\/a><br \/>\n<br \/>\n<br \/>\n<a href=\"http:\/\/www.amazon.co.jp\/exec\/obidos\/ASIN\/4774150363\/nanoappli-22\/\" target=\"_blank\"><img src=\"http:\/\/ec2.images-amazon.com\/images\/I\/51VkQjM187L._SL160_.jpg\" alt=\"4774150363\" border=\"0\" \/><\/a><br \/>\n<a href=\"http:\/\/www.amazon.co.jp\/exec\/obidos\/ASIN\/4774150363\/nanoappli-22\/\" target=\"_blank\">\u30b5\u30fc\u30d0\u69cb\u7bc9\u306e\u5b9f\u969b\u304c\u308f\u304b\u308b Apache[\u5b9f\u8df5]\u904b\u7528\/\u7ba1\u7406 (Software Design plus) <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>RewriteRule\u306e\u5b9a\u7fa9\u3092.htaccess\u306b\u884c\u3063\u305f\u969b\u3001\u8a2d\u5b9a\u306b\u3088\u3063\u3066\u3001\u30d6\u30e9\u30a6\u30b6\u306eURL\u6b04\u304c\u66f8\u304d\u63db\u308f\u3063\u305f\u308a\u3001\u63db\u308f\u3089\u306a\u304b\u3063\u305f\u308a\u3057\u305f\u306e\u3067\u3001\u305d\u306e\u8fba\u306e\u4ed5\u69d8\u3092\u6539\u3081\u3066\u8abf\u3079\u305f\u7d50\u679c\u306e\u30e1\u30e2\u3067\u3059\u3002 URL\u66f8\u304d\u63db\u3048\u306e\u57fa\u672c .htaccess\u3067RewriteRule\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u6307\u5b9a\u3055\u308c\u305fURL\u3092\u66f8\u304d\u63db\u3048\u308b\u4e8b\u304c\u51fa\u6765\u308b\u3002 \u4f8b\u3048\u3070\u3001\u4e0b\u8a18\u306e\u30eb\u30fc\u30eb\u306f\u3001\u4efb\u610f\u306eURL\u6307\u5b9a\u306b\u5bfe\u3057\u3066\u3082\u3001Yahoo\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u3002 \u3053\u306e\u66f8\u304d\u63db\u3048\u30eb\u30fc\u30eb\u306f\u3001.htaccess\u304c\u5b58\u5728\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306eURL\u306b\u5bfe\u3057\u3066\u9069\u7528\u3055\u308c\u308b\u3002 RewriteRule ^.*$ http:\/\/www.yahoo.co.jp\/ \u3053\u306e\u969b\u306e\u30a2\u30c9\u30ec\u30b9\u30d0\u30fc\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[1],"tags":[102],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":7370,"url":"http:\/\/nanoappli.com\/blog\/archives\/7370","url_meta":{"origin":3017,"position":0},"title":"[\u30ed\u30ea\u30dd\u30c3\u30d7]\u72ec\u81ea\u30c9\u30e1\u30a4\u30f3\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u3044\u308b\u3068\u304d\u306b\u8a2d\u5b9a\u3059\u3079\u304d.htaccess\u306e\u5b9a\u7fa9","date":"2016\u5e744\u67082\u65e5","format":false,"excerpt":"\u30ec\u30f3\u30bf\u30eb\u30b5\u30fc\u30d0\u306e\u30ed\u30ea\u30dd\u30c3\u30d7\u3067\u306f,\u30ed\u30ea\u30dd\u30c3\u30d7\u304c\u7528\u610f\u3057\u305f\u30c9\u30e1\u30a4\u30f3\u4ee5\u5916\u306b\u3001\u81ea\u5206\u3067\u30c9\u30e1\u30a4\u30f3\u3092\u53d6\u5f97\u3057\u3001\u72ec\u81ea\u30c9\u30e1\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2322,"url":"http:\/\/nanoappli.com\/blog\/archives\/2322","url_meta":{"origin":3017,"position":1},"title":"WordPress\u3067\u4f5c\u3063\u305f\u30b5\u30a4\u30c8(blog)\u3092\u3001\u30d6\u30e9\u30a6\u30b6\u306e&#8221;\u691c\u7d22\u30d7\u30e9\u30b0\u30a4\u30f3&#8221;\u306b\u8ffd\u52a0\u3059\u308b","date":"2012\u5e744\u670829\u65e5","format":false,"excerpt":"Firefox\u3084IE\u306b\u306f\u3001\u753b\u9762\u4e0a\u90e8\u306e\u30a2\u30c9\u30ec\u30b9\u8868\u793a\u6b04\u306e\u53f3\u306b\u3001\u691c\u7d22\u30d0\u30fc\u304c\u6709\u308a\u307e\u3059\u3002 \u691c\u7d22\u30d0\u30fc\u3092\u4f7f\u3046\u3068\u3001\u4eba\u2026","rel":"","context":"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/nanoappli.com\/blog\/wp-content\/uploads\/2012\/04\/20120429_04.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3942,"url":"http:\/\/nanoappli.com\/blog\/archives\/3942","url_meta":{"origin":3017,"position":2},"title":"[C\u8a00\u8a9e\u5165\u9580]printf\u306e\u66f8\u5f0f\u6307\u5b9a","date":"2012\u5e747\u670810\u65e5","format":false,"excerpt":"\u524d\u56de\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u3001printf\u306e\u5f15\u6570\u306b%d\u3092\u6307\u5b9a\u3059\u308b\u4e8b\u3067\u3001int\u578b\u306e\u5909\u6570\u5024\u3092\u8868\u793a\u3055\u305b\u3066\u3044\u307e\u3057\u305f\u3002 \u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":586,"url":"http:\/\/nanoappli.com\/blog\/archives\/586","url_meta":{"origin":3017,"position":3},"title":"Apache+PHP\u3067\u8907\u6570\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u30c7\u30fc\u30bf\u751f\u6210\u3092\u30b9\u30de\u30fc\u30c8\u306b\u51e6\u7406\u3059\u308b","date":"2012\u5e741\u670817\u65e5","format":false,"excerpt":"PHP\u3067web\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u3068\u3001\u52d5\u7684\u306b\u751f\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u305b\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 \u2026","rel":"","context":"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/nanoappli.com\/blog\/wp-content\/uploads\/20120117_03.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2736,"url":"http:\/\/nanoappli.com\/blog\/archives\/2736","url_meta":{"origin":3017,"position":4},"title":"\u8d85!A&#038;G+ \u306e\u756a\u7d44\u914d\u4fe1\u7528URL\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5","date":"2012\u5e745\u670822\u65e5","format":false,"excerpt":"\u524d\u56de\u66f8\u3044\u305f\u8a18\u4e8b\u3067\u3001\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u518d\u751f\u306eURL\u3092\u5165\u529b\u3059\u308b\u7b87\u6240\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306f\u3053\u306eURL\u306e\u7279\u5b9a\u306e\u4ed5\u2026","rel":"","context":"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/nanoappli.com\/blog\/wp-content\/uploads\/2012\/05\/20120521_04-500x302.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":270,"url":"http:\/\/nanoappli.com\/blog\/archives\/270","url_meta":{"origin":3017,"position":5},"title":"MarkdownSharp.dll\u306e\u5909\u63db\u7d50\u679c\u3092\u30d6\u30e9\u30a6\u30b6\u8868\u793a\u7d50\u679c\u3068\u3057\u3066\u30d7\u30ec\u30d3\u30e5\u30fc\u3059\u308b","date":"2012\u5e741\u67086\u65e5","format":false,"excerpt":"\u524d\u56de\u307e\u3067\u306e\u8a18\u4e8b\u3067\u3001C#\u304b\u3089Markdown\u5f62\u5f0f\u306e\u30c6\u30ad\u30b9\u30c8\u3092html\u30c6\u30ad\u30b9\u30c8\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3057\u305f\u2026","rel":"","context":"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/nanoappli.com\/blog\/wp-content\/uploads\/20120106_05.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/3017"}],"collection":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/comments?post=3017"}],"version-history":[{"count":5,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/3017\/revisions"}],"predecessor-version":[{"id":3116,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/3017\/revisions\/3116"}],"wp:attachment":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/media?parent=3017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/categories?post=3017"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/tags?post=3017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}