Custom permilink / rewrite / hooks to rewrite urls
-
I’ve ported a database application from a traditional legacy web environment over to wordpress. I need to do some custom URL rewriting in order to make the new wordpress pages appear at the old address. The plugin I wrote uses query_vars extensively whereas the old web addresses just used parts of the URL.
For example:
old link: /mysite.com/foo/20/20100.html
new link: /mysite.com/foo/article?number=20100old link: /mysite.com/foo/index_january_2010.html
new link: /mysite.com/foo/index?month=1&year=2010Of course, one way to do this is with apache mod-rewrite (the first case above should be trivial; the second a bit more complicated as it involves changing strings to integer).
However, since I’ve written this all up as a wordpress plugin, I’d like to be able to do the rewriting inside my plugin. Is there a particular wordpress filter or action hook that I can use that would let me get at the URL and rewrite it? I’m thinking wordpress already has something in there for interpreting permalinks and my task is not so different, so there ought to be a hook I can tap into.
Thanks,
Scott
- The topic ‘Custom permilink / rewrite / hooks to rewrite urls’ is closed to new replies.