after searching for a while I couldn’t figure out how to solve this issue:
I have a client’s website, say: client.com, which I am hosting as part of the company’s website, company.com.
Client.com is currently permanently redirected to company.com.
I installed a wordpress site on company.com/client, and want client.com to point to the /client subdirectory, but keep client.com in the URL.
I was able to do this, but when I click one of the links on the client’s website, like “About Us,” it shows the new page, but stays at client.com instead of client.com/aboutus.
How can I make this happen? As in, how can I make the URL dynamic?
In the root directory of company.com I have the following .htaccess:
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?client.com/$ RewriteRule ^(.*)$ /client%{REQUEST_URI} [NC,L] RewriteRule ^((?!client).*) /client%{REQUEST_URI} [L,NC]
In the /client directory I have just the WP installed .htaccess:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
Read more here: Redirecting a New Domain to Existing Subdirectory with WP Installation