Page 1 of 1

.htaccess for shutting down one site of multisite

Posted: Fri Jun 26, 2020 9:03 am
by coolshop
We have 2 sites on multisite 2.3.0.2

Default site, and site that admin runs under is
https://www.domaina.com
https://www.domaina.com/admin

Second site is:
https://www.domainb.com

Both point to the same opencart directory

We are shutting down the first site and continuing to run the second site.

Since both sites point to one directory with the same .htaccess, how do we need to setup .htaccess to 301 redirect all traffic to https://www.domaina.com to https://www.domainb.com EXCEPT https://www.domaina.com/admin (so that we can keep running the admin)

Any help or advice appreciated!

Re: .htaccess for shutting down one site of multisite

Posted: Sat Jun 27, 2020 4:06 am
by netruxa
hello
try this code:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domaina.com$
RewriteCond %{REQUEST_URI} !^/admin
RewriteRule ^(.*) https://www.domainb.com/$1 [L,R]

Re: .htaccess for shutting down one site of multisite

Posted: Sun Jun 28, 2020 9:46 am
by coolshop
That worked - thank you!!