( 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.)ģ. (By root, I mean the Alternately, you can use your FTP application and MOVE the index.php “to the parent” but then you MUST read and follow step 6 below. Using an FTP application or your web host’s File Manager, DOWNLOAD the index.php file that is in the WordPress application directory (not the one in your theme’s folder or elsewhere) and then UPLOAD the copy you downloaded to the root directory. Set this to your site’s root address (without the trailing slash).Ģ. What you do need to change is the Site address URL. Note: This will already be displayed in the WordPress address field, so you don’t have to change it. ![]() From the Settings -> General tab, set your WordPress address URL to the subdirectory you installed WordPress in (without the trailing slash). Displaying WordPress URLs from root directory when WordPress is installed in a sub directoryġ. Your database username and password are in the wp-config.php file. Having an index.html and index.php in the same folder causes confusion, and likely, the index.html will be used instead of WordPress’ index.php file Ĭ) Make sure you don’t have any other folders in the root directory that have the same name as any pages on your WordPress site, for example “blog” unless of course this is the name of your subdirectory install of WordPress in which case you cannot have a page of the same name because the browser will get confused and look for that page in that folder, then things are really confused ĭ) Use wp-db-backup to make a backup of your database – Į) Be sure you have access to your database via phpMyAdmin on your web host’s control panel in case you type the URLs wrong in the next step. You MUST remove all those old site files and folders or move them into another directory, so they don’t interfere with WordPress. Also, de-activate Broken Link Checker and any Redirection plugins ī) Remove any old site files from the root directory - perhaps copy them to a folder called _backup – this includes an index.html file which will totally make this process not work. Before attempting to move WordPressĪ) Clear ALL pages cached by your caching plugin cache AND then de-activate the caching plugin. Also, if you have a lot of internal hyperlinks, you will need to manually update those. Note: If this is an older site, you will need to create 301 redirects to redirect your old page/post URLs to the new page/post URLs. Once you’re finished with your WordPress development, you can backup and then delete your current site’s files, and use the following instructions to display WordPress from the root directory of the site. It allows you to develop a new WordPress site while maintaining your current website in the root directory.I’m not sure how obscure this really makes WordPress, because you can obviously get the subdirectory name from any images uploaded to the site, since they will still read as /subdirectory/wp-content/uploads/image.jpg, so I usually install WP in a subdirectory for development purposes or to simply keep the root directory clean in case I install any subdomains or other applications. Ideally, you want to name the subdirectory something not too obvious (ie don’t call it wp or WordPress). ![]() It adds a layer of security through obscurity by obscuring the location of your WordPress application files.It keeps your root directory clean and tidy (in case you need to add any other PHP applications to your site). ![]() Installing WordPress in a subdirectory can be a good idea because: They are similar instructions by slightly different. you can view the site via an address like instead of ), then please see Moving WordPress from a Subdomain to a Root Directory instructions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |