Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    What’s the point of a query parameter that has no value assigned? It’d be equivalent to not passing a query var at all, so why bother? Behavior is appropriate when a value is passed, like ?param=foo.

    Thread Starter camerondavison

    (@camerondavison)

    We have google ads and other links where the params may not be filled in.

    Moderator bcworkz

    (@bcworkz)

    OK, but $_GET['param'] is an empty string with or without the =, so it shouldn’t matter if it’s there or not.

    No matter, if the = is so important, you can add it yourself after WP strips it out via the “redirect_canonical” filter. The trick will be in only doing so when there’s only “param” and not “param=foo”. preg_replace() with an appropriate regexp ought to do the job. A good regexp should also properly handle a condition like example.com/param/?param.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Home Page Strange Canonical Redirect’ is closed to new replies.