Hey,
Can’t get the bottom of the correct .htaccess rule to achieve the following:
[server.example.com]) \- the WordPress install[example.com]) \- the React frontend
I want all requests to [server.example.com]) to redirect to [example.com]) except:
[server.example.com/wp-admin]) [server.example.com/wp-content])*and some others, but i can add these into the rule later.*
I have tried the following rule (and many others) but can’t get the correct redirect. This rule allows access to /wp-admin and successfully redirects [server.example.com]) to [example.com]) but will not redirect [server.example.com/anything\_else]) to [example.com])
<IfModule mod\_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST\_URI} !\^/(wp-content|wp-admin|wp-login.php)($|/) \[NC\]
RewriteRule \^ [https://example.com]{REQUEST\_URI} \[R=301,L\]
</IfModule>
Any advice appreciated!
[ad_2]