[Mediawiki-l] mediawiki behind reverse proxy - relative links

ralf-buero at kruedewagen.de ralf-buero at kruedewagen.de
Thu Sep 15 09:12:21 UTC 2005


Hi,

I am trying to run mediawiki (v1.4.0) behind a reverse proxy. The 
reverse proxy is set up with Apache2 mod_proxy module.

The problem is now, that mediawiki is using an absolute path in href 
links, which I can't handle with mod_proxy. 

Example of a mediawiki link in HTML-Source:
<a href="/mediawiki/index.php/Special:Recentchanges" .....>

My $wgScriptPath is set to "/mediawiki". My mod_proxy config looks 
like:
------------------------------------
ProxyPass /app1/ http://192.168.1.1/
ProxyPass /app1 http://192.168.1.1
<Location /app1/>
	ProxyPassReverse /
</Location>
<Location /mediawiki/>
              ProxyPassReverse /app1
</Location>
------------------------------------
 Note: The Location directive is an alternative of
  "ProxyPassReverse /app1/ http://192.168.1.1/", see  
 http://www.apacheweek.com/features/reverseproxies.

When I access http://www.myproxy.com/app1/, the mediawiki pages are 
loaded well. The Browser URL is set to 
http://www.myproxy.com/app1/mediawiki/index.php/Main_Page. Fine.
But all links in the nagigation box are pointing to e.g. 
http://www.myproxy.com/mediawiki/index.php/Special:Recentchanges. The 
"/app1" is missing here, so the navigation links fail. This is 
because mediawiki sends always an abolute href path back.

I have tried to set $wgScriptPath to "./mediawiki", "mediawiki" or 
"../../mediawiki". But that didn't work.

Has anybody experiences with running mod_proxy towards mediawiki ? How 
can I set mediawiki to use relative links in HTML sources ? Any other 
suggestions ?

Thanks in advance
Ralf



More information about the MediaWiki-l mailing list