Is there a way to handle base directories for taxonomies that result in a 404. For example my URLs are:
http://skipology.com/category/…
http://skipology.com/app/…
but the taxonomies / base directories above result in 404. Can they be redirected to a taxonomy index page (which I may need to create) for example without impacting the child directory (post) or is there a better option. If so how? I suspect the answer lies in redirects but I’m not confident.
You can manually create pages named category
and app
in admin under the Pages
menu, and use a custom page template for each to list out taxonomy terms or whatever you need.
EDIT – 301 redirect a request that matches the pagename
rewrite to another page:
function wpa_parse_query( $query ){
if( isset( $query->query_vars['pagename'] )
&& 'apps' == $query->query_vars['pagename'] ){
wp_redirect( home_url( '/other-page/' ), 301 );
exit;
}
}
add_action( 'parse_query', 'wpa_parse_query' );