I know that it's impossible to have the same custom post type slug as a page.

So, I thought it might be resolved in this way:

'rewrite' => array('slug' => 'my-category/!#') for register_post_type

But I get "Page not found" every time I visit /my-category/!#/title-1

As you understand, I also have a page named "/my-category".

Is it somehow possible to resolve this conflict?

  • 3
    You have a zero acceptance rate... Doesn't really encourage other to answer this question. After you have changed the rewrite slug have you gone to permalinks settings page and hit save to flush the permalinks?
    – Scott
    Commented May 17, 2011 at 9:45
  • @Brady I have flush_rewrite_rules(false);. Doesn't that do the same thing? Commented May 17, 2011 at 9:50
  • 1
    It feels wrong to accept answers that have not solved the problems. Commented May 17, 2011 at 11:09
  • 2
    then perhaps you might want to respond and clarify so that you get to a solution. If you're not willing to put in a bit of effort, then people will naturally be more reluctant to help
    – anu
    Commented May 17, 2011 at 11:18

2 Answers 2


It is not impossible, but you need to be very careful to prevent conflicts. You can use my Rewrite analyzer plugin to look at your current rules.

The structure you propose, where the custom post type is stored in the URL hash (the part after the #), will not work because this part is not sent to the server. So the server will just see a request for my-category/!, not for my-category/!#/my-post. (Is it possible you switched the # and the !? The custom is to use #!/ as the hash start.)

How to solve this depends on whether you currently have verbose page rules, and this depends on your current permalink structure. Can you edit your question to add this?


What's happening is that the backend thinks that !#/title-1 is a child/next page of my-category. I've been looking at something like this today, and it just causes conflict.

I found a plugin called Custom Post Permalinks which does what I want. The only thing is is that it appears to reset itself if you add a new Custom Post Type. I'm not sure how it'll handle with your hashbang #!/.

Your Answer

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

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