Double page load because WordPress redirects plus char to percent 20
-
Hi,
when I am using a html form on my website, WordPress redirects this url:
- example.com/?test=my+input+data
- to this url: example.com/?test=my%20input%20data
This results in a double page load (!) and the reason is this action:
#wp-includes/default-filters.php:606 add_action( 'template_redirect', 'redirect_canonical' );
When I comment out this line everything is fine.
I noticed that this does not happen, when I use the “s” parameter.
- for example: example.com/?s=my+input+data
How can I exlude another parameter (so that it behaves like “s”)?
Or remove this action?I tried things like this, but I could not make it work:
function remove_wp_redirect() { if ( strpos($_SERVER["REQUEST_URI"], '+') !== false ) { remove_action( 'template_redirect', 'redirect_canonical' ); } } add_action( 'init', 'remove_wp_redirect' );
Any ideas? ??
Thank you
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Double page load because WordPress redirects plus char to percent 20’ is closed to new replies.