I have my WordPress site hosted in Wp-Engine. The Url for the site is https://www.example.com/blogs.
I have another AEM site at https://www.example.com
. I have the following Web Rules in Wp-Engine for redirection.
1. Internal rewrite /blogs/(.*) /$1
2. Permanent redirect (301 status code) `/blogs https://www.example.com/blogs`
Now I have the following issues.
I am not able to access
https://www.example.com/blogs/wp-admin
directly. It is going tohttps://www.example.com/404.html
. But I can accesshttps://www.example.com/blogs/edit.php
orhttps://www.example.com/blogs/plugins.php
When I perform a search on Posts or Users, I am redirected to
https://www.example.com/wp-admin/edit.php?s=dummy&post_status=all&post_type=post&action=-1&m=0&cat=0&layout=63bff7d64f656&paged=1&action2=-1
Note there are no /blogs
added, so it is looking into the AEM site for the page, and as it is not there, it is again a 404 page.
I have added the following rule, but it is also not working.
Permanent redirect (301 status code) /wp-admin/(.*) http://www.example.com/blogs/$1
It would be very helpful if someone could point me in the right direction.
Update: It seems like the issue is when there is a query string in the URI. There is a 302 redirect, which cuts the blogs
part from the URL