How to remove the subdirectory name from your WordPress website address


In this example of subdirectory redirection, we’ll be using .htaccess to properly redirect a website address such that both the website and WordPress dashboard load without the subdirectory name. Our domain for this example will be “your-domain-name.com”
Within the public directory, often named public_html or html, you should see the following settings for a standard WordPress permalinks setup:
# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

The above works perfectly fine when your main domain name is located at the top of your public directory–not so well if your site is located in a subdirectory like “blog”
To enable your website to function properly within your blog subdirectory, but without showing the blog subdirectory name, we actually need to change three different files, shown in the picture at right:
The first file we’ll edit is the .htaccess file (contents shown above), to:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?your-domain-name.com$
Source: https://managewp.org/articles/14336/how-to-remove-the-subdirectory-name-from-your-wordpress-website-address




source https://williechiu40.wordpress.com/2017/02/05/how-to-remove-the-subdirectory-name-from-your-wordpress-website-address-2/