Changing WordPress Site URL from Subdomain to Sub Directory

Solution:

Rewrite your wp-config.php with this code

define(‘SUBDOMAIN_INSTALL’, false);
instead of define(‘SUBDOMAIN_INSTALL’, true);

then goto:

http://www.website.com/wp-admin/network/setup.php
then:

Add the following to your .htaccess file in /var/www/vhosts/website.com/, replacing other WordPress rules:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]