redirect - URL is redirecting (301) when query string is passed through URL

admin2025-01-07  5

301 redirection is happening and redirected URL is losing the parameters while passing query strings via URL.

When I try to pass the query string “type=Brochure” as shown in below URL /?type=Brochure

It is getting redirected to / and query the string is lost.

But it is working fine if I change the subdomain from www (both www and test URLs are available for testing, try replacing www with test)

I am unable to figure out why this redirection is happening in the case of www.

Note: We could not fix the issue even after following steps below: – All URLs in DB are proper. – We tried the same setup in localhost (with host file entry mapping to edgeverve) – We tried updating WordPress to 4.8 – Also, we tried to handle it via .htaccess

301 redirection is happening and redirected URL is losing the parameters while passing query strings via URL.

When I try to pass the query string “type=Brochure” as shown in below URL https://www.edgeverve.com/resources/?type=Brochure

It is getting redirected to https://www.edgeverve.com/resources/ and query the string is lost.

But it is working fine if I change the subdomain from www (both www and test URLs are available for testing, try replacing www with test)

I am unable to figure out why this redirection is happening in the case of www.

Note: We could not fix the issue even after following steps below: – All URLs in DB are proper. – We tried the same setup in localhost (with host file entry mapping to edgeverve.com) – We tried updating WordPress to 4.8 – Also, we tried to handle it via .htaccess

Share Improve this question asked Jul 28, 2017 at 20:40 Sudarshan G HegdeSudarshan G Hegde 13 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

Faced the same issue. In my case, WooCommerce's filter uses get parameters to keep product filtering settings. Any way

As was mentioned by @sudarshan-g-hedge, redirection caused by Yoast SEO plugin

The reason is Crawl optimization's URL cleanup settings in this plugin

What you need to do to prevent such redirects is:

  • go to admin panel
  • open "Yoast SEO" -> "Settings"
  • navigate to "Advanced" heading and choose there "Crawl optimization"
  • scroll to the "Advanced: URL cleanup" section
  • add desired get parameters (e.g., type as in question) into "Additional URL parameters to allow" box
  • save changes

The issue got resolved by disabling Yoast SEO plugin. What would be the reason for Yoast SEO plugin to cause this issue?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736264841a998.html

最新回复(0)