{"id":1052,"date":"2006-03-19T11:10:49","date_gmt":"2006-03-19T05:40:49","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/2006\/03\/host-wordpress-in-alternative-directory\/"},"modified":"2026-10-12T18:57:35","modified_gmt":"2026-10-12T13:27:35","slug":"host-wordpress-in-alternative-directory","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2006\/03\/host-wordpress-in-alternative-directory\/","title":{"rendered":"How to Install WordPress in a Subdirectory (and Serve It from the Root)"},"content":{"rendered":"<p>Readers often asked why our URLs include \/archives\/. In 2006 I didn&#8217;t want WordPress files cluttering the root folder, in case I later installed forums or a wiki, so I installed WordPress in quickonlinetips.com\/archives\/. If you want to <strong>install WordPress in a subdirectory<\/strong> too, there are two ways to do it. Here&#8217;s how each works in 2026.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-64743\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/install-wordpress-in-a-subdirectory-1024x538.webp\" alt=\"Install WordPress in a subdirectory\" width=\"1024\" height=\"538\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/install-wordpress-in-a-subdirectory-1024x538.webp 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/install-wordpress-in-a-subdirectory-300x158.webp 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/install-wordpress-in-a-subdirectory-150x79.webp 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/install-wordpress-in-a-subdirectory-768x403.webp 768w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/install-wordpress-in-a-subdirectory.webp 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> To run your whole site at a subfolder address (example.com\/blog\/), simply install WordPress in that folder. To keep WordPress files in a subfolder but show the site at example.com, install it in the subfolder, set Site Address (URL) to the root in Settings &gt; General, then copy index.php (and .htaccess) to the root and change the require line to point to the subfolder.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6aeaea530f6a9\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6aeaea530f6a9\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/03\/host-wordpress-in-alternative-directory\/#Option_1_Site_lives_at_a_subfolder_URL\" >Option 1: Site lives at a subfolder URL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/03\/host-wordpress-in-alternative-directory\/#Option_2_Files_in_a_subfolder_site_at_the_root\" >Option 2: Files in a subfolder, site at the root<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/03\/host-wordpress-in-alternative-directory\/#Things_to_check\" >Things to check<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/03\/host-wordpress-in-alternative-directory\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/03\/host-wordpress-in-alternative-directory\/#Is_a_subdirectory_bad_for_SEO\" >Is a subdirectory bad for SEO?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/03\/host-wordpress-in-alternative-directory\/#Can_I_move_WordPress_from_a_subfolder_to_the_root_later\" >Can I move WordPress from a subfolder to the root later?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/03\/host-wordpress-in-alternative-directory\/#What_if_I_get_locked_out_after_changing_the_Site_Address\" >What if I get locked out after changing the Site Address?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Option_1_Site_lives_at_a_subfolder_URL\"><\/span>Option 1: Site lives at a subfolder URL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Your blog appears at example.com\/blog\/ and the root can hold something else (a landing page or another app).<\/p>\n<ol>\n<li>Create the folder (for example \/blog\/) in your hosting file manager.<\/li>\n<li>Install WordPress there with your host&#8217;s installer or manually.<\/li>\n<li>Both WordPress Address and Site Address will be https:\/\/example.com\/blog.<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Option_2_Files_in_a_subfolder_site_at_the_root\"><\/span>Option 2: Files in a subfolder, site at the root<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This is WordPress&#8217;s official &#8220;giving WordPress its own directory&#8221; method.<\/p>\n<ol>\n<li>Install WordPress in a subfolder, such as \/wp\/.<\/li>\n<li>In <strong>Settings &gt; General<\/strong>, keep WordPress Address as https:\/\/example.com\/wp and set Site Address to https:\/\/example.com. Save.<\/li>\n<li>Copy (don&#8217;t move) <strong>index.php<\/strong> and <strong>.htaccess<\/strong> from \/wp\/ to the root.<\/li>\n<li>Edit the root index.php: change <code>require __DIR__ . '\/wp-blog-header.php';<\/code> to <code>require __DIR__ . '\/wp\/wp-blog-header.php';<\/code><\/li>\n<li>Go to Settings &gt; Permalinks and click Save to refresh rules.<\/li>\n<\/ol>\n<p>The login page stays at example.com\/wp\/wp-admin\/. Full details are in the <a href=\"https:\/\/developer.wordpress.org\/advanced-administration\/server\/wordpress-in-directory\/\" rel=\"noopener\" target=\"_blank\">WordPress documentation<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Things_to_check\"><\/span>Things to check<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Take a backup before changing site addresses; a typo can lock you out.<\/li>\n<li>Moving an existing site? Changing URLs needs 301 redirects and a search-replace of old links.<\/li>\n<li>Caching and security plugins may need their paths updated.<\/li>\n<\/ul>\n<p>Testing first? You can <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/06\/how-to-install-wordpress-locally-on-your-computer\/\">install WordPress locally<\/a> and practise the setup safely.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Is_a_subdirectory_bad_for_SEO\"><\/span>Is a subdirectory bad for SEO?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No. Google treats subfolder URLs normally. Pick one structure and keep it.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_move_WordPress_from_a_subfolder_to_the_root_later\"><\/span>Can I move WordPress from a subfolder to the root later?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, but URLs change, so set up 301 redirects from old addresses.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_if_I_get_locked_out_after_changing_the_Site_Address\"><\/span>What if I get locked out after changing the Site Address?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Define WP_HOME and WP_SITEURL in wp-config.php to restore the correct addresses.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Readers often asked why our URLs include \/archives\/. In 2006 I didn&#8217;t want WordPress files cluttering the root folder, in&#8230;<\/p>\n","protected":false},"author":4,"featured_media":64743,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6,36],"tags":[17],"class_list":["post-1052","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","category-about","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/1052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=1052"}],"version-history":[{"count":1,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/1052\/revisions"}],"predecessor-version":[{"id":64744,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/1052\/revisions\/64744"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/64743"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=1052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=1052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=1052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}