{"id":132,"date":"2019-10-31T14:59:40","date_gmt":"2019-10-31T14:59:40","guid":{"rendered":"http:\/\/blog.davcloud.top\/?p=132"},"modified":"2020-01-26T16:17:20","modified_gmt":"2020-01-26T16:17:20","slug":"solution-of-redirect-of-wordpress","status":"publish","type":"post","link":"https:\/\/blog.davcloud.top\/?p=132","title":{"rendered":"Solution of redirection of WordPress"},"content":{"rendered":"\n<h2>Abstract<\/h2>\n\n\n\n<p>This article aims to solve the redirect problem of WordPress.<\/p>\n\n\n\n<h2>Step 1. Check the website address<\/h2>\n\n\n\n<p>Check the website address in the admin page, make sure it is correct. It is in the Settings\/General page.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"400\" height=\"261\" src=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2019\/10\/image.png\" alt=\"\" class=\"wp-image-139\" srcset=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2019\/10\/image.png 400w, https:\/\/blog.davcloud.top\/wp-content\/uploads\/2019\/10\/image-300x196.png 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"723\" height=\"126\" src=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2019\/10\/image-1.png\" alt=\"\" class=\"wp-image-141\" srcset=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2019\/10\/image-1.png 723w, https:\/\/blog.davcloud.top\/wp-content\/uploads\/2019\/10\/image-1-300x52.png 300w\" sizes=\"(max-width: 723px) 100vw, 723px\" \/><\/figure><\/div>\n\n\n\n<h2>Step 2. Open the template-loader.php <\/h2>\n\n\n\n<p>Open the template-loader.php file. Assume the root dir of the wordpress is \u201cwordpress\u201d. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># If the dir required root permission, add sudo at the beginning.\nvim \/wordpress\/wp-includes\/template-loader.php<\/code><\/pre>\n\n\n\n<h2>Step 3. Edit the file<\/h2>\n\n\n\n<p>Edit the template-loader.php, comment the following codes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if( defined(\u2018WP_USE_THEMES\u2019) &amp;&amp; WP_USE_THEMES )\ndo_action(\u2018template_redirect\u2019);<\/code><\/pre>\n\n\n\n<h2>Step 4.  Save the file and refresh<\/h2>\n\n\n\n<p>Save the file and refresh your website, it is ok now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Abstract This article aims to solve the redirect problem of WordPress. Step 1. Check the website address Check the website address in the admin page, make sure it is correct. It is in the Settings\/General page. Step 2. Open the template-loader.php Open the template-loader.php file. Assume the root dir of the wordpress is \u201cwordpress\u201d. Step [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[27],"tags":[33,31],"_links":{"self":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts\/132"}],"collection":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=132"}],"version-history":[{"count":10,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":1362,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts\/132\/revisions\/1362"}],"wp:attachment":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}