{"id":11409,"date":"2025-10-10T06:25:30","date_gmt":"2025-10-10T06:25:30","guid":{"rendered":"https:\/\/withcode.tech\/media\/?p=11409"},"modified":"2026-06-18T10:29:07","modified_gmt":"2026-06-18T10:29:07","slug":"redirect_setup","status":"publish","type":"post","link":"https:\/\/withcode.tech\/media\/redirect_setup\/","title":{"rendered":"\u30102026\u5e74\u6700\u65b0\u3011WordPress\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u8a2d\u5b9a\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c301\/302\u306e\u9055\u3044\u30fb\u30b3\u30fc\u30c9\u5b9f\u88c5\u30fb\u30d7\u30e9\u30b0\u30a4\u30f3\u6d3b\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac"},"content":{"rendered":"<div class=\"swell-block-balloon\">\n<div class=\"c-balloon -bln-left\" data-col=\"gray\">\n<div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-14.40.37.jpg\" alt=\"\u751f\u5f92\u30a2\u30a4\u30b3\u30f3\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u751f\u5f92<\/span><\/div>\n<div class=\"c-balloon__body -speaking -border-none\">\n<div class=\"c-balloon__text\">\n<p><strong>\u30da\u30f3\u535a\u58eb\uff01WordPress\u3067\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u306e\u3067\u3059\u304c\u3001\u65b9\u6cd5\u304c\u305f\u304f\u3055\u3093\u3042\u3063\u3066\u4f55\u304b\u3089\u624b\u3092\u3064\u3051\u308c\u3070\u3044\u3044\u304b\u5206\u304b\u3089\u306a\u304f\u3066\u56f0\u3063\u3066\u3044\u307e\u3059\u2026<\/strong><\/p>\n<\/div>\n<p><span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"swell-block-balloon\">\n<div class=\"c-balloon -bln-right\" data-col=\"gray\">\n<div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-15.09.27.jpg\" alt=\"\u30da\u30f3\u535a\u58eb\u30a2\u30a4\u30b3\u30f3\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u30da\u30f3\u535a\u58eb<\/span><\/div>\n<div class=\"c-balloon__body -speaking -border-none\">\n<div class=\"c-balloon__text\">\n<p><strong>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306fSEO\u306b\u3082\u76f4\u7d50\u3059\u308b\u91cd\u8981\u306a\u8a2d\u5b9a\u3058\u3083\uff01\u4ed5\u7d44\u307f\u3092\u7406\u89e3\u3059\u308c\u3070\u6016\u304f\u306a\u3044\u305e\u3002\u30b3\u30fc\u30c9\u5b9f\u88c5\u304b\u3089\u30d7\u30e9\u30b0\u30a4\u30f3\u307e\u3067\u3001\u72b6\u6cc1\u306b\u5fdc\u3058\u305f\u6700\u9069\u306a\u65b9\u6cd5\u3092\u4e00\u7dd2\u306b\u5b66\u3093\u3067\u3044\u3053\u3046\uff01<\/strong><\/p>\n<\/div>\n<p><span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"swell-block-balloon\">\n<div class=\"c-balloon -bln-left\" data-col=\"gray\">\n<div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-14.48.08.jpg\" alt=\"\u751f\u5f92\u30a2\u30a4\u30b3\u30f3\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u751f\u5f92<\/span><\/div>\n<div class=\"c-balloon__body -speaking -border-none\">\n<div class=\"c-balloon__text\">\n<p><strong>\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01SEO\u306b\u3082\u95a2\u4fc2\u3042\u308b\u3093\u3067\u3059\u306d\u3002\u3057\u3063\u304b\u308a\u5b66\u3073\u305f\u3044\u3067\u3059\uff01<\/strong><\/p>\n<\/div>\n<p><span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"wp-block-paragraph\">\u300c\u8a18\u4e8b\u306eURL\u3092\u5909\u66f4\u3057\u305f\u3089\u691c\u7d22\u9806\u4f4d\u304c\u6025\u843d\u3057\u305f\u300d\u300c\u53e4\u3044URL\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068404\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3057\u307e\u3046\u300d\u300c\u30b5\u30a4\u30c8\u3092HTTPS\u306b\u79fb\u884c\u3057\u305f\u3044\u3051\u3069\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u8a2d\u5b9a\u304c\u4e0d\u5b89\u2026\u300d\u2014\u2014\u3053\u3046\u3057\u305f\u60a9\u307f\u3092\u62b1\u3048\u3066\u3044\u308bWordPress\u30e6\u30fc\u30b6\u30fc\u306f\u5c11\u306a\u304f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p class=\"wp-block-paragraph\">\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u8a2d\u5b9a\u306fSEO\u30fb\u30e6\u30fc\u30b6\u30fc\u4f53\u9a13\u30fb\u30b5\u30a4\u30c8\u79fb\u884c\u306e\u3059\u3079\u3066\u306b\u5f71\u97ff\u3059\u308b\u91cd\u8981\u306a\u4f5c\u696d\u3067\u3059\u3002\u6b63\u3057\u304f\u8a2d\u5b9a\u3059\u308c\u3070\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\u306e\u8a55\u4fa1\u3092\u7dad\u6301\u3057\u305f\u307e\u307e\u5b89\u5168\u306bURL\u3092\u5909\u66f4\u3067\u304d\u307e\u3059\u304c\u3001\u8aa4\u308b\u3068\u5927\u5207\u306a\u88ab\u30ea\u30f3\u30af\u3084SEO\u8a55\u4fa1\u3092\u4e00\u6c17\u306b\u5931\u3046\u30ea\u30b9\u30af\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p class=\"wp-block-paragraph\">\u672c\u8a18\u4e8b\u3067\u306f\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u57fa\u672c\u7684\u306a\u4ed5\u7d44\u307f\u304b\u3089\u300c301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u300d\u300c302\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u300d\u306e\u9055\u3044\u3001<strong>.htaccess\u3084functions.php\u3092\u4f7f\u3063\u305f\u30b3\u30fc\u30c9\u5b9f\u88c5<\/strong>\u3001\u521d\u5fc3\u8005\u3067\u3082\u6271\u3044\u3084\u3059\u3044<strong>WordPress\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u3088\u308b\u8a2d\u5b9a\u65b9\u6cd5<\/strong>\u307e\u3067\u3001\u30b9\u30c6\u30c3\u30d7\u3054\u3068\u306b\u4e01\u5be7\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u8aad\u307f\u7d42\u3048\u308b\u3053\u308d\u306b\u306f\u3001\u81ea\u5206\u306e\u30b5\u30a4\u30c8\u306b\u6700\u9069\u306a\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u81ea\u4fe1\u3092\u6301\u3063\u3066\u8a2d\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<h2>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3068\u306f\uff1fWordPress\u3067\u8a2d\u5b9a\u304c\u5fc5\u8981\u306a\u7406\u7531<\/h2>\n<p class=\"wp-block-paragraph\">\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\uff08Redirect\uff09\u3068\u306f\u3001\u3042\u308bURL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u3084bot\uff08\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\u306e\u30af\u30ed\u30fc\u30e9\u30fc\uff09\u3092\u3001\u5225\u306eURL\u3078\u81ea\u52d5\u7684\u306b\u8ee2\u9001\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/p>\n<p class=\"wp-block-paragraph\">\u305f\u3068\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5834\u9762\u3067\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul class=\"wp-block-list\">\n<li>\u8a18\u4e8b\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af\uff08URL\uff09\u3092\u5909\u66f4\u3057\u305f\u3068\u304d<\/li>\n<li>HTTP\u304b\u3089HTTPS\u3078SSL\u5316\u30fb\u79fb\u884c\u3059\u308b\u3068\u304d<\/li>\n<li>\u30c9\u30e1\u30a4\u30f3\u3092\u5909\u66f4\u30fb\u5f15\u8d8a\u3057\u3057\u305f\u3068\u304d<\/li>\n<li>\u524a\u9664\u3057\u305f\u30da\u30fc\u30b8\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u5225\u30da\u30fc\u30b8\u3078\u8a98\u5c0e\u3057\u305f\u3044\u3068\u304d<\/li>\n<li>www\u6709\u308a\u3068\u7121\u3057\u3092\u7d71\u4e00\u3057\u305f\u3044\u3068\u304d<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u8a2d\u5b9a\u3057\u306a\u3044\u307e\u307eURL\u3092\u5909\u66f4\u3059\u308b\u3068\u3001\u53e4\u3044URL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u306f\u300c404 Not Found\uff08\u30da\u30fc\u30b8\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\uff09\u300d\u30a8\u30e9\u30fc\u306b\u76f4\u9762\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u30e6\u30fc\u30b6\u30fc\u4f53\u9a13\u3092\u8457\u3057\u304f\u640d\u306a\u3046\u3060\u3051\u3067\u306a\u304f\u3001Google\u304c\u305d\u306e\u30da\u30fc\u30b8\u306b\u4ed8\u4e0e\u3057\u3066\u3044\u305fSEO\u8a55\u4fa1\uff08\u88ab\u30ea\u30f3\u30af\u306e\u8cc7\u7523\u306a\u3069\uff09\u3082\u6d88\u5931\u3057\u3066\u3057\u307e\u3046\u539f\u56e0\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3068302\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u9055\u3044\u3092\u6b63\u3057\u304f\u7406\u89e3\u3059\u308b<\/h2>\n<p class=\"wp-block-paragraph\">\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u306f\u7a2e\u985e\u304c\u3042\u308a\u3001\u7528\u9014\u306b\u3088\u3063\u3066\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u7279\u306b\u3088\u304f\u4f7f\u308f\u308c\u308b\u300c301\u300d\u3068\u300c302\u300d\u306e\u9055\u3044\u3092\u62bc\u3055\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\uff08\u6052\u4e45\u7684\u306a\u8ee2\u9001\uff09<\/h3>\n<p class=\"wp-block-paragraph\">301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306f\u300c\u3053\u306eURL\u306f\u6052\u4e45\u7684\u306b\u79fb\u8ee2\u3057\u307e\u3057\u305f\u300d\u3068\u3044\u3046\u610f\u5473\u3092\u6301\u3061\u307e\u3059\u3002\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\u306b\u5bfe\u3057\u3066\u65e7URL\u306eSEO\u8a55\u4fa1\uff08PageRank\u306a\u3069\uff09\u3092\u65b0URL\u3078\u5f15\u304d\u7d99\u3050\u3088\u3046\u4f1d\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u305f\u3081\u3001<strong>URL\u3092\u6c38\u7d9a\u7684\u306b\u5909\u66f4\u3059\u308b\u30b1\u30fc\u30b9\u3067\u306f\u5fc5\u305a301\u3092\u4f7f\u7528\u3059\u308b<\/strong>\u306e\u304c\u57fa\u672c\u3067\u3059\u3002<\/p>\n<ul class=\"wp-block-list\">\n<li>\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u306e\u6052\u4e45\u7684\u306a\u5909\u66f4<\/li>\n<li>HTTP \u2192 HTTPS\u3078\u306e\u79fb\u884c<\/li>\n<li>\u30c9\u30e1\u30a4\u30f3\u79fb\u8ee2<\/li>\n<li>www\u6709\u308a\u30fb\u7121\u3057\u306e\u7d71\u4e00<\/li>\n<\/ul>\n<h3>302\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\uff08\u4e00\u6642\u7684\u306a\u8ee2\u9001\uff09<\/h3>\n<p class=\"wp-block-paragraph\">302\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306f\u300c\u3053\u306eURL\u306f\u4e00\u6642\u7684\u306b\u5225\u306e\u5834\u6240\u3078\u79fb\u52d5\u3057\u3066\u3044\u307e\u3059\u300d\u3068\u3044\u3046\u610f\u5473\u3092\u6301\u3061\u307e\u3059\u3002SEO\u8a55\u4fa1\u306f\u5143\u306eURL\u306b\u6b8b\u3063\u305f\u307e\u307e\u306b\u306a\u308b\u305f\u3081\u3001<strong>\u4e00\u6642\u7684\u306a\u30ad\u30e3\u30f3\u30da\u30fc\u30f3\u30da\u30fc\u30b8\u3084\u5de5\u4e8b\u4e2d\u30da\u30fc\u30b8\u3078\u306e\u8a98\u5c0e<\/strong>\u306a\u3069\u306b\u4f7f\u3044\u307e\u3059\u3002\u8aa4\u3063\u3066302\u3092\u4f7f\u3044\u7d9a\u3051\u308b\u3068\u3001SEO\u8a55\u4fa1\u304c\u65b0URL\u306b\u79fb\u8ee2\u3055\u308c\u306a\u3044\u307e\u307e\u6642\u9593\u304c\u7d4c\u904e\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p class=\"is-style-icon_info wp-block-paragraph\"><strong>\u3010\u307e\u3068\u3081\u3011301 vs 302\u306e\u4f7f\u3044\u5206\u3051<\/strong><br \/>URL\u3092\u6052\u4e45\u7684\u306b\u5909\u66f4 \u2192 <strong>301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/strong>\uff08SEO\u8a55\u4fa1\u304c\u65b0URL\u3078\u5f15\u304d\u7d99\u304c\u308c\u308b\uff09<br \/>\u4e00\u6642\u7684\u306a\u8ee2\u9001\u30fb\u30ad\u30e3\u30f3\u30da\u30fc\u30f3\u8a98\u5c0e \u2192 <strong>302\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/strong>\uff08SEO\u8a55\u4fa1\u306f\u5143URL\u306b\u7559\u307e\u308b\uff09<\/p>\n<h2>WordPress\u3067\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u8a2d\u5b9a\u3059\u308b3\u3064\u306e\u65b9\u6cd5<\/h2>\n<p class=\"wp-block-paragraph\">WordPress\u3067\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u306f\u4e3b\u306b3\u3064\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u30e1\u30ea\u30c3\u30c8\u30fb\u30c7\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308b\u305f\u3081\u3001\u81ea\u5206\u306e\u30b9\u30ad\u30eb\u30ec\u30d9\u30eb\u3084\u7528\u9014\u306b\u5408\u308f\u305b\u3066\u9078\u3073\u307e\u3057\u3087\u3046\u3002<\/p>\n<ol class=\"wp-block-list\">\n<li><strong>.htaccess\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u65b9\u6cd5<\/strong>\uff08Apache\u74b0\u5883\u5411\u3051\uff09<\/li>\n<li><strong>functions.php\u306b\u30b3\u30fc\u30c9\u3092\u8ffd\u8a18\u3059\u308b\u65b9\u6cd5<\/strong><\/li>\n<li><strong>\u30d7\u30e9\u30b0\u30a4\u30f3\uff08Redirection\u7b49\uff09\u3092\u4f7f\u3046\u65b9\u6cd5<\/strong><\/li>\n<\/ol>\n<h2>\u3010\u65b9\u6cd5\u2460\u3011.htaccess\u3092\u4f7f\u3063\u305f\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u8a2d\u5b9a\uff08\u30b3\u30fc\u30c9\u5b9f\u88c5\uff09<\/h2>\n<p class=\"wp-block-paragraph\">.htaccess\uff08\u30c9\u30c3\u30c8\u30a8\u30a4\u30c1\u30c6\u30a3\u30fc\u30a2\u30af\u30bb\u30b9\uff09\u306fApache\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002WordPress\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5b58\u5728\u3057\u3001\u3053\u3053\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u30eb\u30fc\u30eb\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>.htaccess\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u6240\u3068\u7de8\u96c6\u65b9\u6cd5<\/h3>\n<p class=\"wp-block-paragraph\">.htaccess\u306fFTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\uff08FileZilla\u306a\u3069\uff09\u307e\u305f\u306f\u30ec\u30f3\u30bf\u30eb\u30b5\u30fc\u30d0\u30fc\u306e\u30d5\u30a1\u30a4\u30eb\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002WordPress\u306e\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08\u901a\u5e38\u306f\u300cpublic_html\u300d\u76f4\u4e0b\uff09\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p class=\"is-style-icon_announce wp-block-paragraph\"><strong>\u7de8\u96c6\u524d\u306b\u306f\u5fc5\u305a\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u308b\u3053\u3068\uff01<\/strong><br \/>.htaccess\u306e\u8a18\u8ff0\u30df\u30b9\u306f\u30b5\u30a4\u30c8\u5168\u4f53\u306b\u5f71\u97ff\u3057\u307e\u3059\u3002\u7de8\u96c6\u524d\u306b\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u4fdd\u5b58\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u57fa\u672c\u30b3\u30fc\u30c9\uff08\u7279\u5b9aURL\u3092\u8ee2\u9001\uff09<\/h3>\n<p class=\"wp-block-paragraph\">\u7279\u5b9a\u306eURL\u3092\u5225\u306eURL\u3078301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"wp-block-code\"><code># \u7279\u5b9a\u30da\u30fc\u30b8\u306e301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\nRedirect 301 \/old-page\/ https:\/\/example.com\/new-page\/<\/code><\/pre>\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u3001\u300c\/old-page\/\u300d\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u3059\u3079\u3066\u300chttps:\/\/example.com\/new-page\/\u300d\u3078\u8ee2\u9001\u3057\u307e\u3059\u3002<\/p>\n<h3>HTTP\u304b\u3089HTTPS\u3078\u306e\u4e00\u62ec\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/h3>\n<p class=\"wp-block-paragraph\">SSL\u5316\uff08HTTPS\u5316\uff09\u306b\u969b\u3057\u3066\u3001\u3059\u3079\u3066\u306eHTTP\u30a2\u30af\u30bb\u30b9\u3092HTTPS\u3078\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"wp-block-code\"><code>RewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/code><\/pre>\n<h3>www\u3042\u308a\u30fb\u306a\u3057\u3092\u7d71\u4e00\u3059\u308b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/h3>\n<p class=\"wp-block-paragraph\">\u300cwww.example.com\u300d\u3068\u300cexample.com\u300d\u3092\u7d71\u4e00\u3059\u308b\u5834\u5408\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002www\u7121\u3057\u306b\u7d71\u4e00\u3059\u308b\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"wp-block-code\"><code>RewriteEngine On\nRewriteCond %{HTTP_HOST} ^www\\.example\\.com [NC]\nRewriteRule ^(.*)$ https:\/\/example.com\/$1 [L,R=301]<\/code><\/pre>\n<p class=\"wp-block-paragraph\">\u300cexample.com\u300d\u306e\u90e8\u5206\u306f\u3054\u81ea\u8eab\u306e\u30c9\u30e1\u30a4\u30f3\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30c9\u30e1\u30a4\u30f3\u5168\u4f53\u3092\u5225\u30c9\u30e1\u30a4\u30f3\u3078\u79fb\u8ee2\u3059\u308b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/h3>\n<p class=\"wp-block-paragraph\">\u65e7\u30c9\u30e1\u30a4\u30f3\u304b\u3089\u65b0\u30c9\u30e1\u30a4\u30f3\u3078\u30b5\u30a4\u30c8\u3054\u3068\u79fb\u8ee2\u3059\u308b\u969b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"wp-block-code\"><code>RewriteEngine On\nRewriteCond %{HTTP_HOST} ^old-domain\\.com [NC]\nRewriteRule ^(.*)$ https:\/\/new-domain.com\/$1 [L,R=301]<\/code><\/pre>\n<h2>\u3010\u65b9\u6cd5\u2461\u3011functions.php\u3092\u4f7f\u3063\u305f\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u8a2d\u5b9a<\/h2>\n<p class=\"wp-block-paragraph\">WordPress\u306e\u30c6\u30fc\u30de\u30d5\u30a1\u30a4\u30eb\u300cfunctions.php\u300d\u306bPHP\u30b3\u30fc\u30c9\u3092\u8ffd\u8a18\u3057\u3066\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3059\u3002\u7279\u5b9a\u306e\u6761\u4ef6\uff08\u30ed\u30b0\u30a4\u30f3\u72b6\u614b\u3001\u30e6\u30fc\u30b6\u30fc\u30ed\u30fc\u30eb\u306a\u3069\uff09\u306b\u5fdc\u3058\u305f\u52d5\u7684\u306a\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u5b9f\u73fe\u3057\u305f\u3044\u5834\u5408\u306b\u6709\u52b9\u3067\u3059\u3002<\/p>\n<h3>\u7279\u5b9a\u30da\u30fc\u30b8\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u57fa\u672c\u30b3\u30fc\u30c9<\/h3>\n<pre class=\"wp-block-code\"><code>function my_custom_redirect() {\n    if ( is_page( 'old-page' ) ) {\n        wp_redirect( home_url( '\/new-page\/' ), 301 );\n        exit;\n    }\n}\nadd_action( 'template_redirect', 'my_custom_redirect' );<\/code><\/pre>\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u30b9\u30e9\u30c3\u30b0\u304c\u300cold-page\u300d\u306e\u30da\u30fc\u30b8\u3078\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u300c\/new-page\/\u300d\u3078301\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3057\u307e\u3059\u3002<code>wp_redirect()<\/code>\u306e\u7b2c2\u5f15\u6570\u3067\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\uff08301\u307e\u305f\u306f302\uff09\u3002<\/p>\n<h3>\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u3092\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u3078\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/h3>\n<pre class=\"wp-block-code\"><code>function redirect_non_logged_in_users() {<br \/>\n    if ( ! is_user_logged_in() && is_page( 'members-only' ) ) {<br \/>\n        wp_redirect( wp_login_url( get<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u8a2d\u5b9a\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u5fb9\u5e95\u89e3\u8aac\u3002301\/302\u306e\u9055\u3044\u3001.htaccess\u3084functions.php\u3067\u306e\u30b3\u30fc\u30c9\u5b9f\u88c5\u3001Redirection\u7b49\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u6d3b\u7528\u307e\u3067\u624b\u9806\u4ed8\u304d\u3067\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":2,"featured_media":11479,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"swell_btn_cv_data":"","footnotes":"","vk-ltc-link":"","vk-ltc-target":"0"},"categories":[34],"tags":[329,332],"class_list":["post-11409","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","tag-329","tag-332"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/11409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/comments?post=11409"}],"version-history":[{"count":45,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/11409\/revisions"}],"predecessor-version":[{"id":13700,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/11409\/revisions\/13700"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/media\/11479"}],"wp:attachment":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/media?parent=11409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/categories?post=11409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/tags?post=11409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}