{"id":4210,"date":"2011-08-11T09:40:54","date_gmt":"2011-08-11T13:40:54","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=4210"},"modified":"2011-08-11T09:40:54","modified_gmt":"2011-08-11T13:40:54","slug":"move-wp-from-subdir-to-root-dir","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/","title":{"rendered":"Move WP from subdir to root dir"},"content":{"rendered":"<p>From <a href=http:\/\/askwpgirl.com\/how-do-i-move-wordpress-from-a-subdirectory-to-the-root-directory\/ target=\"_blank\" rel=\"noopener noreferrer\">askwpgirl.com<\/a><\/p>\n<p> Q. I\u2019ve installed my website in a subdirectory of our domain, because I didn\u2019t want visitors to see the site until I was finished with our development.<br \/>\nNow I want to have the site show up in the root directory (not in the http:\/\/mydomain.com\/wordpress directory). How do I do this? I\u2019ve read the information on moving WordPress, and it seems really complicated.<\/p>\n<p> A. The good news is that you DO NOT need to MOVE WordPress in order to have your content display without the subdirectory name. You only need to move 1 file and change one line of code and make one modification to your General Settings, and you\u2019re good to go (see instructions below).<\/p>\n<p><strong>Installing WordPress in a subdirectory is good idea because:<\/strong><\/p>\n<p>It keeps your root directory clean and tidy (in case you need to add any other PHP applications to your site).<br \/>\nIt adds another layer of security by obscuring the location of your WordPress application files. Ideally, you want to name the subdirectory something not too obvious (ie don\u2019t call it wp or WordPress).<\/p>\n<p>It allows you to develop a new WordPress site while maintaining your current website in the root directory. Once you\u2019re finished with your WordPress development, you can backup and then delete your current site\u2019s files, and use the following instructions to display WordPress from the root directory of the site.<\/p>\n<p><strong>\u201cMoving\u201d WordPress from Subdirectory to the Site\u2019s Root Directory<\/strong><\/p>\n<p>1. Install WordPress as you normally would, but instead of installing it in the root directory (ie in the www or public_html directory), install it in a subdirectory in the www or public_html folder.<\/p>\n<p>2. Once you\u2019ve completed your design work, adding pages to the site, etc., login to the WordPress Dashboard. From the Settings -> General tab, set your WordPress address URL to the subdirectory you installed WordPress in (without the trailing slash). Note: This will already be displayed in the WordPress address field, so you don\u2019t have to change it. What you do need to change is the Site address URL. Set this to  your site\u2019s root address (without the trailing slash).<\/p>\n<p>3. Next, MOVE (do not copy) the index.php file that is in the WordPress application directory to the root directory. You can usually do this in an FTP application by selecting the file and choosing Move. (Do not move the index.php file in the themes folder or any other folder.) (Note: If you have a site already in the root directory, such as an old static html site, then you should backup and delete those files first.)<\/p>\n<p>4. In a text or HTML editor, open the index.php file that you just moved and change the location of your wp-blog-header.php to the new location.<br \/>\nExample: if your WordPress installation folder is \u2018mywp\u2019, you would change:<br \/>\n<code>< ?php require('.\/wp-blog-header.php'); ?><\/code><br \/>\nto<br \/>\n<code>< ?php require('.\/mywp\/wp-blog-header.php'); ?><\/code><\/p>\n<p>5. Visit the site and click an interior page to make sure it displays correctly. If it doesn\u2019t, you may need to update your permalinks (Settings -> Permalinks and click Save Changes). If you still cannot access your interior pages, then the .htaccess may need to be moved to the same location as the index.php file (i.e. the root directory). This is not necessary on all web hosts. Be sure to update the permalinks again after you move the .htaccess file.<\/p>\n<p>Remember that your login and registration links will still be<br \/>\nhttp:\/\/www.yoursite.com\/mywp\/wp-login.php.<\/p>\n<p>Now, when people visit your site, they will see all the URLs of all the pages and posts as if you had installed WordPress in the root directory, and you will have a neat WordPress directory behind the scenes.<\/p>\n<p>From <a href=http:\/\/askwpgirl.com\/how-do-i-move-wordpress-from-a-subdirectory-to-the-root-directory\/ target=\"_blank\" rel=\"noopener noreferrer\">askwpgirl.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>From askwpgirl.com Q. I\u2019ve installed my website in a subdirectory of our domain, because I didn\u2019t want visitors to see the site until I was finished with our development. Now I want to have the site show up in the root directory (not in the http:\/\/mydomain.com\/wordpress directory). How do I do this? I\u2019ve read the&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-4210","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Move WP from subdir to root dir - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Move WP from subdir to root dir - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"From askwpgirl.com Q. I\u2019ve installed my website in a subdirectory of our domain, because I didn\u2019t want visitors to see the site until I was finished with our development. Now I want to have the site show up in the root directory (not in the http:\/\/mydomain.com\/wordpress directory). How do I do this? I\u2019ve read the... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2011-08-11T13:40:54+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/move-wp-from-subdir-to-root-dir\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/move-wp-from-subdir-to-root-dir\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Move WP from subdir to root dir\",\"datePublished\":\"2011-08-11T13:40:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/move-wp-from-subdir-to-root-dir\\\/\"},\"wordCount\":633,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"Wordpress\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/move-wp-from-subdir-to-root-dir\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/move-wp-from-subdir-to-root-dir\\\/\",\"name\":\"Move WP from subdir to root dir - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2011-08-11T13:40:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/move-wp-from-subdir-to-root-dir\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/move-wp-from-subdir-to-root-dir\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/move-wp-from-subdir-to-root-dir\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Move WP from subdir to root dir\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Move WP from subdir to root dir - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/","og_locale":"en_US","og_type":"article","og_title":"Move WP from subdir to root dir - Linux Shtuff","og_description":"From askwpgirl.com Q. I\u2019ve installed my website in a subdirectory of our domain, because I didn\u2019t want visitors to see the site until I was finished with our development. Now I want to have the site show up in the root directory (not in the http:\/\/mydomain.com\/wordpress directory). How do I do this? I\u2019ve read the... Read More","og_url":"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2011-08-11T13:40:54+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Move WP from subdir to root dir","datePublished":"2011-08-11T13:40:54+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/"},"wordCount":633,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["Wordpress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/","url":"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/","name":"Move WP from subdir to root dir - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2011-08-11T13:40:54+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/move-wp-from-subdir-to-root-dir\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Move WP from subdir to root dir"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/4210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=4210"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/4210\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=4210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=4210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=4210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}