faustjs icon indicating copy to clipboard operation
faustjs copied to clipboard

Bug: Redirect Feature does not work when WP instalations is just on a different path to NextJS.

Open slimzc opened this issue 1 year ago • 0 comments

When I use the feature in the FaustJS WP Plugin Enable public route redirects I dont get the correct redirection.

My home_url is -> https://cms/wp My NextJS route is -> https://cms

Debuging I found that

// faustwp/includes/deny-public-access/callbacks.php
$request_uri = home_url( add_query_arg( null, null ) );

I test with

return this -> https://cms/wp/wp/my_blog_path instead of -> https://cms/wp/my_blog_path

Applicable Versions

  • WordPress version: 6.2
  • Faust WP Plugin : 0.8.6

Steps To Reproduce

  1. Create a Wordpress instalation over the same domain that NextJS but in a different path. for example: Wordpress instalation url : https://example.com/wp NextJS instalation url : https://example.com
  2. on Faust WP plugin Enable 'Enable public route redirects'
  3. Go to https://example.com/wp/sample-page

The current behavior

Redirect Loop on browser

The expected behavior

Redirect to https://example.com/sample-page

I test with

// faustwp/includes/deny-public-access/callbacks.php
global $wp
$request_uri = home_url( add_query_arg( $_GET, $wp->request) );

And redirect work like I expected, but I dont meet all test cases.

slimzc avatar May 09 '23 05:05 slimzc