Between WordPress 1.x and 2.x there was a big change to the way rewrite rules are handled.
In the old days, everything got written out to a .htaccess file. Every condition, every form of permalink could be found there, and I had some comfort knowing I could see and mess with it all. I was a bit surprised to find that with 2.0.2, WP writes out a sparse file that has only one significant rule. Something that looks like this:
RewriteRule . /blog/index.php [L]
That one line takes everything in your request URL and passes it through to index.php for processing. The beauty of this is that WP doesn’t need to write to the file system with every change to the permalink structure (which used to include every new “page” added or renamed).
The only downside to this is that you can no longer expect a $_REQUEST array full of all the query terms your plugin might use. Instead you’ll have to use the $wp_query object. All of this was probably mentioned in the API docs before I built a bunch of dependancies on $_REQUEST, but it was easy enough to fix.
$wp_query, $_REQUEST, .htaccess, apache, apache rewrite, rewrite rules, wordpress, wpopac
Posted April 16, 2006 by Casey Bisson
Categories: Technology. Tags: $wp_query, $_REQUEST, .htaccess, apache, apache rewrite, rewrite rules, wordpress, wpopac.
2 Comments
Comments RSS
TrackBack Identifier URI
Leave a comment
User contributed tags for this post:
htaccess catch all (28) - htaccess catchall (17) - apache rewrite catch all (12) - htaccess rewrite rule (11) - rewrite rule htaccess (10) - htaccess rewrite rules (9) - every (9) - wordpress rewrite rules (8) - rewrite rules (6) - apache rewrite catchall (6) - rewrite rule (6) - htaccess rewrite all (6) - wordpress rewrite (6) - htacces rewrite rules (5) - apache2 rewrite rules (4) - catch all htaccess (4) - htaccess rewrtie (4) - catch all rewrite (4) - apache rewrite form post (4) - Rewrite Rules Wordpress (4) - catchall rewrite (4) - Sun T2000 (4) - rewrite rule qsa (4) - rewrite rule change everything (3) - htaccess catch all pages (3) - htaccess rewrite cond (3) - htacces rewrite (3) - rewrite rule in php (3) - os x wordpress htaccess permalink (3) - RewriteRule catch all (3) - wordpress apachec rewrite rules (3) - macosx htaccess (3) - htaccess rewrite catchall (3) - wordpress apache rewrite rules (3) - permalinks rewrite (2) - apache2 rewrite rules in htaccess (2) - wordpress rewrite.php (2) - apache catch all (2) - apache rewrite everything to index.php (2) - htaccess rewrite my (2) - apache rewrite post form (2) - apache rewrite rules form post (2) - apache htaccess rewrite rule QSA (2) - htaccess rewrite rule catch all (2) - apache 2 rewrite rules (2) - htaccess rewrite rule in php (2) - apache rewrite rules QSA (2) - apache rewrite everything (2) - apache rewrite rule in html (2) - apache catchall rewrite (2) - rewriterule apache (2) - rewrite catch all (2) - apache rewrite rules catch all (2) - apache catch all rewrite (2) - .htaccess catchall (2) - htaccess rewrite big (2) - apache rewrite rule everything (2) - php rewrite rule (2) - htaccess rewrite rule for changing url (2) - $_REQUEST htaccess (2) - t2000 sun (2) - apache2 rewrite catalog (2) - rewrite rules htacces (2) - rewrite rules QSA (2) - rewrite rule catch all (2) - apache2 rewrite condition (2) - htaccess rewrite catch all (2) - htaccess and rewrite rule (2) - wp rewrite tiger (2) - apache rewrite for wordpress (2) - rewrite rule catchall (2) - rewrite all index php (2) - rewrite rule htaccess catch all (2) - wordpress rewrite own rules (2) - htaccess macosx rewrite (2) - wordpress rewrite rules 2 0 2 (2) - All WordPress RewriteRules (2) - apache rewrite catch all page requests (2) - t2000 rules file (2) - permalink rewrite rule (2) - htaccess catch all email how to (2) - php apache catch all (2) - rewrite rule rewrite all (2) - wordpress htaccess rewrite rules (2) - apache rewrite rules (2) - htaccess rewrite rule L (2) - apache2 url rewrite rule (1) - apache2 rewrite links (1) - wordpress 2 5 rewrite rules (1) - wordpress rewrite error apache 2 2 (1) - apache2 rewrite rules wordpress permalinks (1) - scriblio htaccess (1) - rewrite everything apache (1) - rewrite rules apache2 (1) - htacces rewriterules (1) - shared apache rewrite rules (1) - how to wordpress rewrite search link rewrite php (1) - apache2 rewrite all pages to index (1) - apache rewrite rule mac os x (1) - wordpress rewrite apache 2 (1) - using apache rewrite rules to catch all (1) - conditional rewrite apache 1 3 (1) - form post rewrite rule (1) - wordpress rewrite rules for pages (1) - htaccess rewrite rule apache 2 2 (1) - apache url rewrite php (1) - scriblio rewrtie rule index php (1) - /index php?tag= rewrite rule WordPress (1) - change permalinks rewrite rules current (1) - where do rewrite rules go in htaccess? (1) - The htaccess Rules for all WordPress Permalinks (1) - wordpress rewrite permalink (1) - rewriterules htacces (1) - Apache reverse RewriteRules (1) - wordpress rewrite php (1) - apache rewriterule form (1) - rewrite rule from apache 1 to apache2 (1) - apache2 rewrite conditional (1) - RewriteRule . /blog/index.php [L (1) - rewrite rules in apache2 (1) - apache2 rewrite catch all (1) - rewrite no $_REQUEST (1) - wordpress rewrite rules paged (1) - .htaccess catch all (1) - apache2 rewrite rules which file (1) - apache rewrite post requests (1) - apache2 catch-all rewrite (1) - apache rewrite everything to index (1) - apache2 conditional rewrite (1) - rewrite rule everything (1) - edit apache rewrite rules oS x (1) - apache rewrite rules oS x (1) - array htaccess wordpress (1) - rewriterule %1 (1) - rewriterule qsa (1) - RewriteRule rewrite everything (1) - rewriterule for all (1) - apache rewrite rule for POST request (1) - rewrite rule for post request in apache (1) - apache2 rewrite rule with wordpress (1) - apache2 rewriting rule [qsa] (1) - apache2 rewrite L (1) - htaccess Permalinks php (1) - apache2 catchall (1) - apache2 rewrite qsa (1) - apache RewriteRule FORM-POST (1) - apache arabic rewrite (1) - apache2 rewrite rules .htaccess (1) - rewriterule catchall (1) - htaccess catch all request (1) -
The hell of this is that if you had handwritten rewrite rules that took calls for old pages “hello? is faq.html there?” and sent them to nicers urls like /faq, this is borked in ways I haven’t entirely been able to fix yet. If you know how to speak .htaccess please let me know.
[tags]htaccess, jessamyn, wordpress, borked[/tags]
Jessamyn: I’m too lazy to actually test this advice, but you’ll want to insert your own rules above the catch-all rule quoted in my post. It should look something like this:
Then save the .htaccess with your changes and set the permissions/ownership so WP can’t rewrite them.