Thanks. You correctly identified the problem. I've now got the following rules:
RewriteRule ^$ w RewriteRule ^w/stylesheets/(.*)$ path/stylesheets/$1 [L] RewriteRule ^w/images/(.*)$ path/images/$1 [L] RewriteRule ^w/(.*)$ path/index.php?title=$1 [L] RewriteRule ^w(.*)$ path/index.php$1 [L]
I think my host's Apache is quite broken. [L] doesn't stop processing (but doesn't seem to hurt anything). The reason my directory is called "path" instead of "wiki" is that a rule of
RewriteRule ^w(.*)$ wiki/index.php$1 [L]
will be applied multiple times (because 'wiki' starts with 'w'), expanding to wiki/index.phpiki/index.phpiki/index.php... until Apache throws an error. The recommended .htaccess file on the MediaWiki pages doesn't work for this reason.
When I tried to replace the final rule (with the bare w) with the rule:
RewriteRule ^w?(.*)$ wiki/index.php?$1 [L]
then http://wise-nano.org/w/Article served back the main page without style sheets, although all the other rules were unchanged. Go figure.
The RewriteCond feature doesn't seem to work at all.
But my rules seem to work OK, so the problem is "solved."
Chris
Brion Vibber wrote:
On Oct 25, 2004, at 2:17 AM, Chris Phoenix wrote:
I initially created the ?'d article. The system doesn't deal well with that. When I edited and saved the page, the page after the save said "There's no text here."
Your rewrite rules are broken; you're probably sending the unescaped URL to index.php/$1, which will turn the ? and anything after it into a query string parameter.
Unfortunately Apache's mod_rewrite doesn't really deal with unescaping/reescaping in a sane fashion. If you change it to index.php?title=$1 then the ? case should work, but & will similarly fail, unless you patch Apache (there is a patch for Apache 1.x in the maintenance/ directory which adds an 'ampescape' function which escapes & to %26)
-- brion vibber (brion @ pobox.com)
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l