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
User contributed tags for this post:
htaccess catch all (30) - htaccess catchall (17) - every (15) - apache rewrite catch all (12) - htaccess rewrite rule (11) - rewrite rule htaccess (10) - htaccess rewrite rules (9) - wordpress rewrite rules (8) - wordpress rewrite (6) - htaccess rewrite all (6) - apache rewrite catchall (6) - rewrite rules (6) - rewrite rule (6) - htacces rewrite rules (5) - apache rewrite form post (4) - Sun T2000 (4) - catch all htaccess (4) - rewrite rule qsa (4) - htaccess rewrtie (4) - catch all rewrite (4) - apache2 rewrite rules (4) - catchall rewrite (4) - Rewrite Rules Wordpress (4) - wordpress apachec rewrite rules (3) - htaccess rewrite cond (3) - htaccess catch all pages (3) - os x wordpress htaccess permalink (3) - RewriteRule catch all (3) - wordpress apache rewrite rules (3) - rewrite rule change everything (3) - htacces rewrite (3) - htaccess rewrite catchall (3) - macosx htaccess (3) - rewrite rule in php (3) - apache catchall rewrite (2) - php rewrite rule (2) - apache2 rewrite catalog (2) - rewriterule apache (2) - rewrite catch all (2) - apache rewrite everything to index.php (2) - apache2 rewrite condition (2) - rewrite rules htacces (2) - apache rewrite rule in html (2) - apache catch all rewrite (2) - htaccess rewrite big (2) - apache rewrite post form (2) - apache rewrite everything (2) - apache rewrite rules catch all (2) - apache htaccess rewrite rule QSA (2) - wordpress rewrite.php (2) - apache rewrite rules QSA (2) - rewrite rule rewrite all (2) - permalink rewrite rule (2) - htaccess rewrite rule for changing url (2) - htaccess catch all email how to (2) - permalinks rewrite (2) - apache rewrite rules form post (2) - All WordPress RewriteRules (2) - apache rewrite rule everything (2) - .htaccess catchall (2) - apache catch all (2) - php apache catch all (2) - apache 2 rewrite rules (2) - htaccess rewrite rule catch all (2) - $_REQUEST htaccess (2) - htaccess rewrite my (2) - apache2 rewrite rules in htaccess (2) - htaccess rewrite rule in php (2) - apache rewrite catch all page requests (2) - wordpress rewrite own rules (2) - wordpress htaccess rewrite rules (2) - rewrite rule htaccess catch all (2) - rewrite rule catchall (2) - rewrite rule catch all (2) - apache rewrite rules (2) - rewrite all index php (2) - htaccess rewrite catch all (2) - apache rewrite for wordpress (2) - htaccess rewrite rule L (2) - wp rewrite tiger (2) - htaccess and rewrite rule (2) - t2000 rules file (2) - rewrite rules QSA (2) - wordpress rewrite rules 2 0 2 (2) - RewriteRule ^(.*) index.php (2) - htaccess macosx rewrite (2) - t2000 sun (2) - apache2 rewrite qsa (1) - apache2 rewrite os x (1) - rewriterule array (1) - rewriterule catchall (1) - qsa rule (1) - RewriteRule .* index.php (1) - apache rewriterule (1) - apache conditionnal rewrite rule (1) - htaccess catch all request (1) - apache2 rewrite qsa example (1) - rewriterule catch-all .* (1) - apache catchall index.php (1) - .htaccess multiple RewriteRule (1) - apache catchall htaccess (1) - Apache2 rewriterule (1) - apache OS X rewrite condition (1) - apache2 rewrite rules .htaccess (1) - rewriteRule every to index.php (1) - apache catchall (1) - htaccess catch all rewrite (1) - where do rewrite rules go in htaccess? (1) - Apache reverse RewriteRules (1) - rewriterules htacces (1) - how to wordpress rewrite search link rewrite php (1) - The htaccess Rules for all WordPress Permalinks (1) - rewriterule apache2.2 (1) - wordpress rewrite php (1) - htaccess rewrite rule apache 2 2 (1) - rewrite post requests (1) - using apache rewrite rules to catch all (1) - apache2 rewrite all pages to index (1) - nginx rewrite rules conditional url (1) - apache rewrite form post wordpress (1) - htaccess catchall html (1) - wordpress rewrite error apache 2 2 (1) - apache2 rewriterule for POST request (1) - wordpress rewrite link in post (1) - apache2 conditional rewrite (1) - rewrite rules apache2 (1) - apache2 rewrite links (1) - apache2 url rewrite rule (1) - wordpress 2 5 rewrite rules (1) - apache RewriteRule FORM-POST (1) - rewriterule apache php json (1) - where do apache rewrite rules go? (1) - rewriterule for all (1) - apache2 rewrite how to (1) - where do rewrite rules go (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) - rewrite rule everything (1) - rewriteRule ^go$ index.php (1) - apache rewrite everything to index (1) - apache2 where do rewrite rules go? (1) - rewrite rule from apache 1 to apache2 (1) - RewriteRule rewrite everything (1) - rewriterule qsa (1) - rewriterule catch-all (1) - apache rewrite catch-all (1) - RewriteRule (.*) index.php (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.