[wp-hackers] URL Re-writes for WP 'Pages' or Multiple Permalink structures

Christopher J. Hradil chradil at comcast.net
Wed Aug 23 13:58:06 GMT 2006


Dilemma - 

I have a site that I need to get EVERYTHING to end in .html (simple for almost everything using a custom permalinks like …%whatever%\.html, I know) problems are:

Pages - created like "write page" - can't seem to figure an "easy" way to achieve this with either pages or things like /category-name type or date based archive pages. 

I already that this isn't really needed, etc, etc, it's not for me, rather someone I'm helping/trying to convince to switch from other platforms to WP. 

he's currently using either b2evolution or MT/TP for his sites/clients, they're 'seo' obsessed, and for now at least they want me to get everything to end in .html (which isn't a bad option for some folks I guess). 

where we'd like to end up is with the following:

www.site-name/pagename.html or www.site-name/2006/08/21.html (for that day's archives) or /2006.html for the years archive page, etc. 

would do site-name/pagename/child-page.html and so on. 

I've done a ton of reading on this over the past couple of days, including the WP codex, links from there, as well as various apache mod_rewrite resources, etc. 

I see two options so far (well three really, but I don't think the third really makes sense from a long term maintainability standpoint)

1) Find a way (or figure out what I'm missing/don't know) to get WP to accept more than one permalink definition using something like the existing -custom field and maybe a ; separator or something, I've noted that the wp core (functions.php) has %page% available as a 'slug' for permalinks already, so this would likely be the easiest and most maintainable method. 
1a) a plugin to accept additional permalink definitions ?

2) Hack the functions file and dupe/hack the re-write functions needed with some if's for page/category/archive situations

3) do it all by hand in .htaccess or /conf/extra/httpd-vhosts.conf 

Main questions:

Is there an existing way to configure more than one permalink structure ?

anyone have any other thoughts/ideas ?


*note -- on #2, we use subversion/trac internally for all projects, so I would maintain a branch for the specific folks that want to do this if I need to mess with core, and keep that up to date with other WP changes, updates/patches, etc, this way it's not a one-off hack so much, and I could maintain upgradeability, etc. for the folks I have that "need" to have everything ending in .html

thanks…chris

~~
Christopher J. Hradil
http://hradil.us 





More information about the wp-hackers mailing list