Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
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
add comment

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer
    
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
add comment

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:

http://codex.wordpress.org/Function_Reference/WP_Rewrite

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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