WordPress is extremely simple and easy to install but sometimes beginners end up installing WordPress in a sub directory instead of the root directory of their site, for example. http://www.example.com/wordpress/ instead of http://www.example.com. If you by chance installed WordPress in a sub directory & now desire to move it to the root directory, then you are in the accurate place. In this article, we will display you how to get rid of /word press/ from your website’s URL.
Note: The method displayed in this lesson works for other sub directories too.
If you have not uploaded any content to your website, then you can remove the existing WordPress install & begin over by following our full WordPress installation tutorial. But, if you already have your website up & working, then continue reading. First of all you require log-in to your WordPress website’s admin area and going to Settings » General. On the settings page, you will observe WordPress Address & Site Address fields & both will have the same URL. You require changing the website Address choice to point to your root domain, e.g. http://www.example.com & leave WordPress Address choice as it is. Once you do that, click on Save Changes button to store your settings.
Next, you require connecting to your website utilizing a FTP client. Once you are linked, go to the /word press/ directory & download the .ht access & index.php files to the Desktop on your pc. It is possible that you may not watch .ht access file in your /word press/ directory because it is a hidden file, & your FTP client may not show it. To watch the hidden file, you require enabling showing hidden files option in your FTP customer. If you are utilizing Filezilla, then you require clicking on Server from the menu bar and selecting ‘Force Showing Hidden Files’ option.
Once you have downloaded both files to your pc Desktop, you require opening
index.php file in a text editor like Notepad. In this file you will discover a line like this:
|require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );|
This line loads wp-blog-header.php file, which is necessary to load the front-finish of your WordPress website. What you require to do now is enter the accurate location of the file by replacing the existing line with this one:
|require( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );|
Save your changes & upload both index.php & .ht access files from your computer to the root of your domain utilizing FTP. The root folder is the parent folder with the word press folder in the interior it typically called /WWW/ or /public_HTML/
That is all. You can now check your website on your major domain & everything will work well. But, if you require to login to your WordPress admin, then you will still require going to the WP-admin inside the word press directory like this:
We are expecting that this tutorial assisted you remove /word press/ from your website’s URL. For response & questions leave a comment below.