Forum Moderators: open
since this is a WP forum, is there a tag for category IP in WP?
We want to mod rewrite in this way
mysite.com/21/124.html
21 is the name of the category
124 is the article ID
How can I make that kind of mod rewrite?
Any help will be greatly appreciated.
thank you
Goto Settings > Permalinks > Custom Structure
/%category%/%post_id%.html
Save the changes. You must have .htaccess and mod_rewrite enabled. See offical docs for more info - [codex.wordpress.org...]
21 is the name of the category
If "21" is actually the name of the category, (and not an "ID" for the category), it will work -- but I assume that is not what what you meant...
Anyway, if you really need to preserve the CATEGORY ID (number) as part of the URL, here's a possible (although complicated) work-around;
You could create WP categories named "21, 22, 23, etc..", then create another set of categories with the actual names... each post would need to posted to "multiple categories" and the permalinks would use the lowest category ID's, (the numbers if you create them first)...
You might get some better idea from:
[codex.wordpress.org...]