Tricky URL rewrite with custom values in url
As I mentioned in your other question, you don’t want to be touching the .htaccess file, you need an internal rewrite. So, given the URL: http://mysite.com/image/wp_username/3digitnumber we need to add the following rule to handle it: // set up the rewrite rule function wpa73374_setup_rewrites(){ add_rewrite_rule( ‘image/([^/]+)/([0-9]+)/?$’, ‘index.php?pagename=custompage&iuser=$matches[1]&iname=$matches[2]’, ‘top’ ); } add_action( ‘init’, ‘wpa73374_setup_rewrites’ ); Note … Read more