Own domain for subfolder installation
-
Hi,
I’m running 2 WordPress multisite installations on the same server. The first one is situated at the root of public_html and the second, newer one has it’s own folder “subfoldername”. I’ve got multiple domains linked to the first installation and I’m managing those with MU domain mapping plugin.
Now, the problem: Is there any way to direct a domain into a subfolder and mask the URLs accordingly?
I added a rewrite rule into the .htaccess, that redirects the incoming traffic with “thenewdomain.com” domain to the subfolder “subfoldername”, which works out fine, but it doesn’t mask the original URL “http://siteroot/subfoldername” with http://thenewdomain.com.
My .htaccess file in the root of public_html looks like this:
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] # --------------------------------------- # BEGIN Domain to folder mapping # pointing examplesite.com to subfolder <strong> RewriteCond %{HTTP_HOST} ^(www.)?thenewdomain.com$ RewriteRule ^(/)?$ subfoldername [L] </strong> # END Domain to folder mapping # --------------------------------------- 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]Can this kind of a “advanced domain mapping” be accomplished?
I apologize for being less than clear trying to explain the problem, but hopefully you guys get the hang of it.
The topic ‘Own domain for subfolder installation’ is closed to new replies.