http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html#canonicalhost needs to be corrected as follows, or else it will fail outside of ASCII. -RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R] +RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R,NE] Otherwise the QUERY_STRING will get doubly escaped!: $ set radioscanningtw.jidanni.org/index.php?title=%E9%A6%96%E9%A0%81\&uselang=en $ w3m -dump http://$1|head Jump to: navigation, search... $ w3m -dump http://www.$1|head The requested page title was invalid, empty, or an incorrectly linked... $ HEAD -PS http://$1|head -n 2 HEAD http://radioscanningtw.jidanni.org/index.php?title=%E9%A6%96%E9%A0%81&uselang=en --> 200 OK $ HEAD -PS http://www.$1|head -n 2 HEAD http://www.radioscanningtw.jidanni.org/index.php?title=%E9%A6%96%E9%A0%81&uselang=en --> 301 Moved Permanently HEAD http://radioscanningtw.jidanni.org/index.php?title=%25E9%25A6%2596%25E9%25A0%2581&uselang=en --> 200 OK (I will tell the MediaWiki people to return 404.) The preceding is the situation on Dreamhost when one clicks their "rewrite my URL without WWW" option on their control panel, and not the product of junior programmer me. It also probably affects those who chose their "Always add WWW" option. So any of their hundreds of thousands of users are affected, the moment any non ASCII is attempted... all presumably due to poor advice there in the Apache manual, perhaps. And the problem was not detected earlier because most of their users are USA ASCII website making people, perhaps. I will tell Dreamhost to have a look at this bug report. However I would also like to note that on my home machine, I needed to change -RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R,NE] +RewriteRule (.*) http://fully.qualified.domain.name/$1 [L,R,NE] during my experiments too.
That doesn't seem right at all. Surely the query string shouldn't be included in what RewriteRule matches at all. Adding [NE] certainly won't hurt, but I don't quite get why it would fix this particular problem.
Done in r774161: although it won't do anything for the query string, it does indeed prevent URIs from getting double-escaped. Thanks for the report.