Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm doing custom URL rewrites according to this method , which work beautifully. But as a result my regular post permalinks are broken.

So, I'm rewriting "/pagename/1232432" into "/pagename?param=1232432" like this:

    $wp_rewrite->add_rewrite_tag( $rewrite_tag, '(.+)', 'param=' );
    $rewrite_keywords_structure = $wp_rewrite->root . "%pagename%/$rewrite_tag/";

(plus all the surrounding code from the example in the link above). Works fine. However, my normal posts like "/2011/03/hello-world/" no longer work.

Any ideas?

Cheers MickP

share|improve this question
    
What is your $ rewrite_tag? –  Bainternet Apr 14 '11 at 19:14
    
bainternet: it's just $rewrite_tag = '%mytag%'; I'm not actually referring to %mytag% anywhere else, though. And am not sure if I should be..? So, in the Admin > Permalinks settings, I've just checked the "Month and name" option, i.e. /%year%/%monthnum%/%postname%/ Frederik: flushing like that doesn't solve it, sadly. Note also that I'm flushing rewrite rules on itit, exactly as in [this example][1]. [1]: matty.co.za/2009/11/custom-url-rewrites-in-wordpress –  MickP Apr 15 '11 at 10:17

2 Answers 2

Well I solved it - in a rather unsatisfactory way - by explicitly re-defining the default posts rule in my own code. i.e.

$rewrite_keywords_structure = $wp_rewrite->root."/%year%/%monthnum%/%postname%/";
..etc..

I don't really understand why this is necessary, but there you go.

share|improve this answer

Have you tried to flush your permalinks? Visiting Admin > Settings > Permalinks should do it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.