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.

My permalinks are: /%postname%

I currently use Custom Post Permalinks to rewrite my permalinks. It work well, but... I dlike to have some url like: www.mysite.com/permalinks_of_my_custom_posts.php >> www.mysite.com/mario-games.php

If I use the plugin to do that I have to write /%list-mario%.php and it's ok,slug is rewrite... Well ... not so much because if I write another custom posts and do the same way, for exemple : /%list-firemen-games.php, it's ok, I have my www.mysite.com/firemen-games.php BUT, www.mysite.com/mario-games.php has became unaccessible.

But, (many butt there sorry :D) If I write something before the slug, for example: /test/%list-mario%.php , my url is ok and it work ... So I have www.mysite.com/test/mario-games.php and www.mysite.com/firemen-games.php and I want www.mysite.com/mario-games.php and www.mysite.com/firemen-games.php and other ...

It s like when I want multiple url like www.mysite.com/mario-games.php a var is erased by another and only the last work.

An other solution would be to have some page.php ...

Thanks for your help !

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The reason adding second permalinks like that makes the first type inaccessible is because WordPress is interpretting both list-firemen-games and list-mario as list-firemen-games post types. To WordPress, the regular expression that is registered looks exactly the same (both look something like ([^/]+)\.php/?), so when it pulls that regular expression, it's going to match that pattern against the first entry it finds in the rewrite rules; in this case, list-firemen-games. The reason it was working when you added test to the permalink is because now the regex for list-mario looks like test/([^/]+)\.php/?.

If you want both types to have the same permastruct, but want to differentiate firemen from mario, I suggest using a custom taxonomy for the post type.

share|improve this answer
    
Nice ! I understand how it work now, Thank you very much :) –  Elium2009 Nov 16 '10 at 19:17

Your Answer

 
discard

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