Step 1: Login to the server and create a folder (/mywebsite) where you want to install WordPress.
Step 2: Login to wordpress dashboard, navigate to Settings >> General Settings.
Step 3: In the box WordPress address (URL), change the address to new location of your main WordPress core files.
URL: http://example.com/mywebsite.
Step 4: In the box Site address (URL), change the address to the root directory and click on Save Changes.
URL : http://example.com
Step 5: Move your WordPress core files to the new location (/mywebsite folder).
Step 6: Now COPY index.php and .htaccess files from /mywebsite folder to root directory, i.e. wwwroot/public_html.
Step 7: Now, open the root directory’s index.php file in a text editor. Replace line
require( dirname( FILE ) . ‘/wp-blog-header.php’ );
with the following line, placing your subdirectory name as follows.
require( dirname( FILE ) . ‘/mywebsite/wp-blog-header.php’ );
Step 8: Browse and login to the new WordPress dashboard. http://example.com/mywebsite/wp-admin/
Step 9: If you have set up Permalinks, update the Permalink structure. At the WordPress dashboard, navigate to Settings >> Permalinks Settings, check the checkbox of permalinks setting you set previously and save the changes.