.htaccess - Redirecting Wordpress site to Ember, except dashboard and API -
i've built ember front-end wordpress site. 2 hosted on separate domains when user clicks "view page" in wordpress dashboard sent page on api site rather front-end of site.
i have created routes match wordpress site, want redirect api ember site, exception of dashboard , api endpoints. useful if, whatever reason, navigates directly api in browser.
so want following:
example-api.com/abc ~> example.com/abc example-api.com/abc/def ~> example.com/abc/def example-api.com/wp-admin ~> work normal example-api.com/wp-json ~> work normal
i've tried following far:
rewriteengine on rewritebase / rewriterule ^!(wp-json|wp-admin)($|/) http://example.com/$1 [r=301,l] # 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
but seems redirect everything.
next:
rewriteengine on rewritebase / rewriterule ^(wp-json|wp-admin)($|/) /index.php [l] rewriterule ^index\.php$ - [l] rewriterule ^(.*)$ http://example.com/$1 [r=301,l] # 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
as thought forward request wp-json , wp-admin index.php usual... still redirects , error "the requested url /index.php not found on server."
any appreciated. ta.
Comments
Post a Comment