[WikiEN-l] ModRewrite problem; seeking advice

Sheldon Rampton sheldon at prwatch.org
Sat Jan 15 07:46:07 UTC 2005


I'm trying to set up our MediaWiki site to use clean URLs and have 
run into a snag. My pages take a long time to load and kick out a 
couple of error messages that say "too many HTTP redirects" for the 
following URLs:

http://www.sourcewatch.org/-?action=raw&ctype=text%2Fcss&smaxage=18000&maxage=18000&gen=css&oldid=0

http://www.sourcewatch.org/-?action=raw&ctype=text%2Fjavascript&smaxage=18000&maxage=18000&gen=js&oldid=0

It appears that these URLs are being generated somehow by the lines 
in xhtml_slim.pt which read as follows:

     <script type="text/javascript" tal:attributes="src jsvarurl"></script>
and:

     <style tal:condition="usercss" type="text/css">/*<![CDATA[*/ 
${usercss} /*]]>*/</style>     <script tal:condition="userjs" 
type="text/javascript" tal:attributes="src userjs"></script><script 
tal:condition="userjsprev" 
type="text/javascript">/*<![CDATA[*/${userjsprev}/*]]>*/</script>
When I delete these lines, the error messages stop.

I've reviewed the MediaWiki page on rewrite rules and am wondering if 
my problem has to do with the ampescape patch that it says is needed 
for Apache. I haven't tried installing the patch and don't know if 
I'll be able to. (The patch says it's for Apache 1.3.26, whereas I 
have 1.3.29. Also, I don't know if my web host will agree to install 
the patch.)

I'm guessing that if I can't patch Apache, I can get away with 
deleting the lines above from xhtml_slim.pt, and everything will work 
except that (1) users won't be able to customize their javascript and 
css, and (2) ampersands won't work in page titles. Is this correct?

The current rewrite rules in my .htaccess file are as follows:

RewriteCond %{REQUEST_URI} !^/(stylesheets|images)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteCond %{REQUEST_URI} !^/robots.txt

# Rewrite http://www.sourcewatch.org/article properly
RewriteRule ^(.*)$ /index.php?title=$1 [L,QSA]

Can someone tell me what I need to do?

Regards,
Sheldon Rampton



More information about the WikiEN-l mailing list