{"id":105,"date":"2025-03-14T17:50:16","date_gmt":"2025-03-14T09:50:16","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/?p=105"},"modified":"2025-06-14T11:44:26","modified_gmt":"2025-06-14T03:44:26","slug":"wordpress%e7%bd%91%e7%ab%99%e9%9a%90%e8%97%8f%e6%88%96%e5%b1%8f%e8%94%bd%e5%a4%96%e9%83%a8%e7%bd%91%e7%ab%99%e7%9c%9f%e5%ae%9eurl%e9%93%be%e6%8e%a5%e7%9a%84%e6%96%b9%e6%b3%95%ef%bc%8c%e6%8f%90","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/105.html","title":{"rendered":"WordPress\u7f51\u7ad9\u9690\u85cf\u6216\u5c4f\u853d\u5916\u90e8\u7f51\u7ad9\u771f\u5b9eURL\u94fe\u63a5\u7684\u65b9\u6cd5\uff0c\u63d0\u5347\u6743\u91cd"},"content":{"rendered":"\n<p>WordPress\u7f51\u7ad9\u9690\u85cf\u6216\u5c4f\u853d\u5916\u90e8\u7f51\u7ad9\u771f\u5b9eURL\u94fe\u63a5\u7684\u65b9\u6cd5\u662f\u5728 WordPress \u7f51\u7ad9\u4e2d\u5b9e\u73b0\u7c7b\u4f3c Base64 \u7f16\u7801 URL + \u670d\u52a1\u5668\u91cd\u5b9a\u5411 \u7684\u6280\u672f\uff0c\u6709\u5229\u4e8e\u63d0\u5347\u7f51\u7ad9\u6743\u91cd\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>WordPress\u7f51\u7ad9<\/strong>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u64cd\u4f5c\u6765\u5b9e\u73b0\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">WordPress\u7f51\u7ad9\u63d2\u4ef6\u5b9e\u73b0\u6cd5\uff08\u9002\u5408\u975e\u6280\u672f\u7528\u6237\uff09<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5b89\u88c5 URL \u91cd\u5b9a\u5411\u63d2\u4ef6<\/strong><br>\u4f7f\u7528\u63d2\u4ef6\u5982 <strong>Redirection<\/strong> \u6216 <strong>Pretty Links<\/strong>\uff0c\u901a\u8fc7\u63d2\u4ef6\u754c\u9762\u8bbe\u7f6e\u52a8\u6001\u89c4\u5219\u3002\u4f8b\u5982\u5728 Redirection \u4e2d\uff0c\u53ef\u521b\u5efa\u6b63\u5219\u8868\u8fbe\u5f0f\u89c4\u5219\uff0c\u5339\u914d <code>?url=([A-Za-z0-9+\/=]+)<\/code> \u683c\u5f0f\u7684\u53c2\u6570\uff0c\u5e76\u8c03\u7528 PHP \u51fd\u6570\u89e3\u7801\u540e\u8df3\u8f6c\u3002<\/li>\n\n\n\n<li><strong>\u77ed\u4ee3\u7801\u751f\u6210\u52a0\u5bc6\u94fe\u63a5<\/strong><br>\u901a\u8fc7\u81ea\u5b9a\u4e49\u63d2\u4ef6\u6216\u4ee3\u7801\u7247\u6bb5\uff0c\u521b\u5efa\u77ed\u4ee3\u7801\uff08\u5982 <code>[base64_redirect url=\"\u76ee\u6807URL\"]<\/code>\uff09\uff0c\u81ea\u52a8\u5c06\u76ee\u6807 URL \u8f6c\u6362\u4e3a Base64 \u7f16\u7801\u7684\u8df3\u8f6c\u94fe\u63a5\u3002\u7528\u6237\u63d2\u5165\u77ed\u4ee3\u7801\u540e\uff0c\u524d\u7aef\u70b9\u51fb\u65f6\u4f1a\u89e6\u53d1\u89e3\u7801\u903b\u8f91\u3002<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">WordPress\u7f51\u7ad9\u81ea\u5b9a\u4e49\u4ee3\u7801\u5b9e\u73b0\uff08\u9002\u5408\u5f00\u53d1\u8005\uff09<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u4e3b\u9898\u6587\u4ef6\u6dfb\u52a0\u89e3\u7801\u903b\u8f91<\/strong><br>\u5728 <code>functions.php<\/code> \u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff0c\u76d1\u542c <code>url<\/code> \u53c2\u6570\u5e76\u91cd\u5b9a\u5411\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   add_action('init', function() {\n       if (isset($_GET&#91;'url'])) {\n           $decoded_url = base64_decode($_GET&#91;'url']);\n           wp_redirect($decoded_url, 302);\n           exit;\n       }\n   });<\/code><\/pre>\n\n\n\n<p>\u6b64\u4ee3\u7801\u4f1a\u62e6\u622a\u7c7b\u4f3c ` \u7684\u8bf7\u6c42\u5e76\u8df3\u8f6c\u3002<\/p>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u81ea\u5b9a\u4e49\u9875\u9762\u6a21\u677f<\/strong><br>\u521b\u5efa\u4e00\u4e2a\u9875\u9762\u6a21\u677f\uff08\u5982 <code>redirect-page.php<\/code>\uff09\uff0c\u901a\u8fc7 <code>get_query_var()<\/code> \u83b7\u53d6\u53c2\u6570\u5e76\u89e3\u7801\uff0c\u9002\u7528\u4e8e\u9700\u8981\u7edf\u8ba1\u70b9\u51fb\u91cf\u7684\u573a\u666f\u3002<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">WordPress\u7f51\u7ad9\u670d\u52a1\u5668\u7ea7\u4f18\u5316\uff08\u9ad8\u6027\u80fd\u65b9\u6848\uff09<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Nginx\/Apache \u91cd\u5b9a\u5411\u89c4\u5219<\/strong><br>\u5728\u670d\u52a1\u5668\u914d\u7f6e\u4e2d\u76f4\u63a5\u5904\u7406 Base64 \u53c2\u6570\uff0c\u4f8b\u5982 Nginx \u914d\u7f6e\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   location \/go\/ {\n       if ($arg_url) { \n           set $decoded_url \"${arg_url}\";\n           rewrite ^.*$ $decoded_url? redirect;\n       }\n   }<\/code><\/pre>\n\n\n\n<p>\u9700\u914d\u5408 <code>ngx_http_rewrite_module<\/code> \u6a21\u5757\u5b9e\u73b0\u52a8\u6001\u89e3\u7801\u3002<\/p>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>.htaccess \u89c4\u5219\uff08Apache\uff09<\/strong><br>\u6dfb\u52a0\u89c4\u5219\u81ea\u52a8\u89e3\u7801 URL \u53c2\u6570\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   RewriteCond %{QUERY_STRING} ^url=(&#91;^&amp;]+)\n   RewriteRule ^go\/?$ \/?url=%1 &#91;R=302,L]<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u5168\u4e0e SEO \u6ce8\u610f\u4e8b\u9879<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u9632\u6b62\u6076\u610f\u6ce8\u5165<\/strong><br>\u9700\u9a8c\u8bc1\u89e3\u7801\u540e\u7684 URL \u5408\u6cd5\u6027\uff0c\u4f8b\u5982\u9650\u5236\u57df\u540d\u767d\u540d\u5355\u6216\u6dfb\u52a0\u7b7e\u540d\u6821\u9a8c\uff08\u5982 HMAC\uff09\u3002<\/li>\n\n\n\n<li><strong>SEO \u53cb\u597d\u6027<\/strong><br>\u4f7f\u7528 301 \u6c38\u4e45\u91cd\u5b9a\u5411\uff08\u5982\u5185\u5bb9\u8fc1\u79fb\uff09\u6216 302 \u4e34\u65f6\u91cd\u5b9a\u5411\uff08\u5982\u63a8\u5e7f\u94fe\u63a5\uff09\uff0c\u907f\u514d\u641c\u7d22\u5f15\u64ce\u60e9\u7f5a\u3002<\/li>\n\n\n\n<li><strong>Base64 \u517c\u5bb9\u6027<\/strong><br>\u66ff\u6362 URL \u4e0d\u5b89\u5168\u7684\u5b57\u7b26\uff08\u5982 <code>+<\/code> \u2192 <code>-<\/code>\uff0c<code>\/<\/code> \u2192 <code>_<\/code>\uff09\uff0c\u5e76\u5728\u89e3\u7801\u65f6\u8fd8\u539f\u3002<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5178\u578b\u5e94\u7528\u573a\u666f<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u9690\u85cf\u63a8\u5e7f\u94fe\u63a5<\/strong><br>\u5c06\u8054\u76df\u8425\u9500\u94fe\u63a5\u52a0\u5bc6\uff0c\u9632\u6b62\u88ab\u722c\u866b\u6293\u53d6\u6216\u7528\u6237\u7be1\u6539\u3002<\/li>\n\n\n\n<li><strong>\u7edf\u8ba1\u70b9\u51fb\u6570\u636e<\/strong><br>\u7ed3\u5408 Google Analytics \u6216 Matomo\uff0c\u5728\u91cd\u5b9a\u5411\u524d\u63d2\u5165\u7edf\u8ba1\u4ee3\u7801\u3002<\/li>\n\n\n\n<li><strong>\u7b80\u5316\u957f\u94fe\u63a5<\/strong><br>\u5c06\u590d\u6742 URL \u8f6c\u6362\u4e3a\u77ed\u94fe\uff08\u5982 <code>***.com\/go\/abc123<\/code>\uff09\uff0c\u63d0\u5347\u5206\u4eab\u4f53\u9a8c\u3002<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0cWordPress \u7f51\u7ad9\u53ef\u7075\u6d3b\u5b9e\u73b0\u57fa\u4e8e Base64 \u7684 URL \u8df3\u8f6c\u6280\u672f\u3002\u63a8\u8350\u4f18\u5148\u4f7f\u7528\u63d2\u4ef6\u65b9\u6848\u964d\u4f4e\u6280\u672f\u95e8\u69db\uff0c\u82e5\u9700\u9ad8\u6027\u80fd\u5219\u9009\u62e9\u670d\u52a1\u5668\u7ea7\u914d\u7f6e\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u7f51\u7ad9\u9690\u85cf\u6216\u5c4f\u853d\u5916\u90e8\u7f51\u7ad9\u771f\u5b9eURL\u94fe\u63a5\u7684\u65b9\u6cd5\u662f\u5728 WordPress \u7f51\u7ad9\u4e2d\u5b9e\u73b0\u7c7b\u4f3c Base64 \u7f16\u7801 URL + \u670d\u52a1\u5668\u91cd\u5b9a\u5411 \u7684\u6280\u672f\uff0c\u6709\u5229\u4e8e\u63d0\u5347\u7f51\u7ad9\u6743\u91cd\u3002 WordPress\u7f51\u7ad9\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u64cd\u4f5c\u6765\u5b9e\u73b0\uff1a WordPress\u7f51\u7ad9\u63d2\u4ef6\u5b9e\u73b0\u6cd5\uff08\u9002\u5408\u975e\u6280\u672f\u7528\u6237\uff09 WordPress\u7f51\u7ad9\u81ea\u5b9a\u4e49\u4ee3\u7801\u5b9e\u73b0\uff08..<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[3189,3190,3191],"tuisongtax":[],"class_list":["post-105","post","type-post","status-publish","format-standard","hentry","category-wpdt","tag-zt","tag-yh","tag-wzyh"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/comments?post=105"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/105\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=105"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}