Move wp-content htacess
Move wp-content htacess
Move wp-content htacess
I don’t think this is a good approuch. I think it’s best to redirect your page at mycpt. let it get the last date in php using your get_posts. And let the page redirect to where you need to be. Don’t go auto updating your .htaccess, that’s not what it is made for.
Take a look at this plugin. It provides hierarchical URLs for categories, but you can easily adapt to any taxonomy.
Permalinks only for posts
URL Rewrite with Custom Variables
404 (category, pages, archives) when using custom rewrite rules
Customise particular RSS permalink
Filter ‘term_link’. Sample code, not tested: add_filter( ‘term_link’, ‘wpse_72848_change_tag_slug’, 10, 3 ); function wpse_72848_change_tag_slug( $termlink, $term, $taxonomy ) { if ( ‘post_tag’ !== $taxonomy ) return $termlink; if ( ‘product’ === $term->slug ) return str_replace( ‘/product/’, ‘/product-powerpoint-ppt/’, $termlink ); return $termlink; }
Help with multisite redirect issues using Cherokee OR solid nginx config?
Within your rewrite() method add: add_rewrite_tag(‘%state%’,'([^&]+)’); add_rewrite_tag(‘%city%’,'([^&]+)’); That will keep the query_vars you added within the url, and prevent it from being stripped.