Skip to content

Instantly share code, notes, and snippets.

@leoj3n
Created September 2, 2012 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoj3n/3593560 to your computer and use it in GitHub Desktop.
Save leoj3n/3593560 to your computer and use it in GitHub Desktop.
Pippins' question: An a WP site, adding query args like this /checkout/?an_action=this is causing 404 errors. Doesn't matter what query arg. Ideas?
// a possible workaround
function my_add_rewrites($content) {
global $wp_rewrite;
$new_non_wp_rules = array(
site_url('checkout/(*)') => plugins_url('checkout.php?$1');
);
$wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $new_non_wp_rules);
return $content;
}
add_action('generate_rewrite_rules', 'my_add_rewrites');
@pippinsplugins
Copy link

checkout.php isn't part the plugin. It's a page on the site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment