[wp-hackers] Integrate URLs from custom plugins?

Jennifer Hodgdon yahgrp at poplarware.com
Tue May 29 14:46:52 GMT 2007

Tobias Nygren wrote [in part]:
> I'm migrating a website to the Wordpress platform. One
> part of the website is a weekly newsletter archive
> where you can access certan newsletters this way: 
> http://domain.com/newsletters/year(number)/week(number)/
> Basicly, what I want to do is to send Wordpress to my
> newsletter page (a wordpress page with a custom
> template) that processes the url and shows the
> newsletter. 

In outline, what you need to do is this, in a plugin:

1) Define a couple of query variables and a rewrite rule in WordPress 
to match your URL structure.

2) Use the the template_redirect action to redirect to your newsletter 
page when this URL is requested.

Here are some reference articles (see also articles referenced in 
these articles, if you need more background):

http://codex.wordpress.org/Query_Overview - explains how WordPress 
processes URLs

http://codex.wordpress.org/Custom_Queries - examples of how to use 
query variables and rewrite rules

Good luck!

More information about the wp-hackers mailing list