0

I am working on a site where they want to break up the content into custom post types (right now everything is broken up by post categories) but they want to be able to save their URLs to preserve inbound links and Facebook Likes. They currently have a date-based URL structure (example.com/2013/01/11/the-post-name) and they want to keep that but still use custom post types.

I've seen plugins that will allow me to easily append the date before the post title in the URL, but nothing that removes the slug from the first URI segment. I tried to add a rewrite rule to remove the slug (rewrite => array( 'slug' => '' )) but that resulted in 404s.

What's the best way to go about this? I know it's bad practice to remove the slug, but the client is pretty adamant about it.

1 Answer 1

0

You can't. Permalink rewrite rules are a set of patterns that the URI is matched against. If they all share the same pattern, one will always take precedence, so you will only have a single post type that will not 404. Categories (or some other taxonomy) is the way to differentiate content that shares the same URL structure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.