Conversation
supportI’m trying to redirect to a URL that includes query parameters, but it seems like anything after the & in the redirect URL gets stripped out. I think its because the redirect URL needs to be urlencoded(). e.g., in simple-page-access-restriction.php:172, if we add urlencode() to the home_url() .$_SERVER[‘REQUEST_URI’], it preserves the parameters. $redirect_url = add_query_arg( $settings[‘redirect_parameter’], urlencode(home_url() . $_SERVER[‘REQUEST_URI’]), $redirect_url );
Hi @tych095 , We have tested this and it is working fine when using query parameters in the URL. Could you please provide more details? eg. current settings and URL. Also, if you could deactivate all other plugins and switch to a standard theme to confirm there are no conflicts. Let us know please if that helps. Thank you.
Hi, I setup a clean install of wordpress and configured as follows: Login Redirect Type: URL Login Redirect URL: /wp-login.php I then set the Privacy-Policy page to be for logged in users only When I try to access the URL with query parameters: http://wordpress.test/privacy-policy/?var1=1&var2=2 it redirects to http://wordpress.test/wp-login.php?redirect_to=http://wordpress.test/privacy-policy/?var1=1&var2=2 which looks fine, however after logging in, the redirect takes me to http://wordpress.test/privacy-policy/?var1=1 Which is missing var2 query parameter
Hi @tych095 , Ah, now we understand your use case and agree with your suggestion. Thank you for bringing this to our attention and for providing the detailed steps to replicate it. We have released a new version of the plugin with this fix. Could you please check the latest release and confirm if it works fine now? Thank you.
Hi @tych095 , We have tested this and it is working fine when using query parameters in the URL. Could you please provide more details? eg. current settings and URL. Also, if you could deactivate all other plugins and switch to a standard theme to confirm there are no conflicts. Let us know please if that helps. Thank you.
Hi, I setup a clean install of wordpress and configured as follows: Login Redirect Type: URL Login Redirect URL: /wp-login.php I then set the Privacy-Policy page to be for logged in users only When I try to access the URL with query parameters: http://wordpress.test/privacy-policy/?var1=1&var2=2 it redirects to http://wordpress.test/wp-login.php?redirect_to=http://wordpress.test/privacy-policy/?var1=1&var2=2 which looks fine, however after logging in, the redirect takes me to http://wordpress.test/privacy-policy/?var1=1 Which is missing var2 query parameter
Hi @tych095 , Ah, now we understand your use case and agree with your suggestion. Thank you for bringing this to our attention and for providing the detailed steps to replicate it. We have released a new version of the plugin with this fix. Could you please check the latest release and confirm if it works fine now? Thank you.