Last active
January 4, 2016 04:20
-
-
Save kkoppenhaver/74886cc4470338916cd5 to your computer and use it in GitHub Desktop.
A reminder of how to configure some common rewrite rules in Wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wp_custom_redirect(){ | |
add_rewrite_rule( | |
'[a-zA-Z-0-9]*\/[0-9]*-[0-9]*-([a-zA-Z0-9-]*).htm', | |
'index.php?name=$matches[1]', | |
'top' | |
); | |
} | |
add_action('init', 'wp_custom_redirect'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment