I'm developing a web application with user submissions, i'm not too hot on mod-rewrite and was hoping there is a way to utilise WordPress' amazing rewrite engine and incorporate this somehow into my PHP/AJAX web application?

  • 1
    To clarify: you want to develop something that does not depend on WordPress, just re-use the rewrite functionality? (Use @Jan in your reply and I get a notification) – Jan Fabry Feb 15 '11 at 13:34
  • @Jan yeah, so each submission somehow gets treated as a post? and therefore gets a fancy url – benhowdle89 Feb 15 '11 at 13:45

I suggest you don't try to take out the WP_Rewrite class and re-use it in your application, but look at other frameworks instead. Many MVC frameworks have nice rewrite engines, that not only offer more flexibility in handling incoming URLs, but also generating internal links according to these formats.

The WordPress rewrite system is tightly coupled to the rest of the code, and for all the effort it would take to rip it out, you can just as easily have learned how to use a "real" framework.

  • Take a look of some of Mike Schinkels trac tickets to get an more in depth view of why you shouldn't use the wp rewrite engine – kaiser Feb 15 '11 at 14:49

You need to know a bit about regular expressions, but you can add your own rewrite rules and variables. There's some good examples and documentation here:


Sorry, I've just reread your question and realised that you want to use Wordpress URL rewriting in an external application. I wouldn't bother doing that if I was you. Either build the whole thing in Wordpress or look at using a framework like Symfony, CodeIgniter or if you want something more simple, Nimble

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.