404 no matter what, compatibility issue?
-
I’m using Permalink Manager to manage all my page url structure (for compatibility with old website), however no matter what I do I get a 404 on the download links (tried this sticky no difference).
When the code gets to the function simple_download_counter_download_handler the $_GET request only contains the query param “key” and nothing else.
I can fix it by also checking the REQUEST URI to grab the parameter needed… thoughts?
if (isset($_GET[$key]) && !empty($_GET[$key])) { $wp->query_vars[$key] = sanitize_key($_GET[$key]); } else { $uri_segments = explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); if ((count($uri_segments) > 3) && ($uri_segments[1] == $key)) { $wp->query_vars[$key] = sanitize_key($uri_segments[2]); } }
- The topic ‘404 no matter what, compatibility issue?’ is closed to new replies.