Skip to content

Instantly share code, notes, and snippets.

@fangcat
Created July 24, 2014 13:09
Show Gist options
  • Save fangcat/6190685d79c88b98bc6d to your computer and use it in GitHub Desktop.
Save fangcat/6190685d79c88b98bc6d to your computer and use it in GitHub Desktop.
停止網址猜測功能
add_filter('redirect_canonical', 'stop_guessing');
function stop_guessing($url) {
if (is_404()) {
return false;
}
return $url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment