[Mediawiki-l] configuration and mod_rewrite

Tim M. Sanders tsanders at synergymicro.com
Thu Dec 4 22:00:15 UTC 2003


I run on Redhat 9.0 with Apache 2.x, PHP 4.2.2 (old I know).

The problem is with the sample LocalSettings.sample (cp to LocalSettings.php) I
believe.  I have the following in my LocalSettings.php file:

	$wgSitename         = "Synergypedia";
	$wgMetaNamespace    = FALSE; # will be same as you set $wgSitename

	$wgServer           = "http://sledge";
	$wgScriptPath       = "/synergypedia";
	$wgArticlePath      = "{$wgScript}?title=$1";
	$wgEmergencyContact = "tsanders at synergymicro.com";

However, when I access some of the links on the Main Page (via
http://sledge/synergypedia/wiki.phtml), the links contain /wiki instead of
/synergypedia.  I seems that the php vars in DefaultSettings.php are not getting
set appropriately based on the settings in the LocalSettings.phph file.  Do I
need to copy the entire block of corresponding links from the
DefaultSettings.php file to override all of them?  I don't know the variable
substituion rules for php.  If I copy the block of vars it works.

	$wgSitename         = "Synergypedia";
	$wgMetaNamespace    = FALSE; # will be same as you set $wgSitename

	#$wgServer           = "http://sledge" . getenv( "SERVER_NAME" );
	$wgServer           = "http://sledge";
	$wgScriptPath       = "/synergypedia";
	$wgScript           = "{$wgScriptPath}/wiki.phtml";
	$wgRedirectScript   = "{$wgScriptPath}/redirect.phtml";
	$wgStyleSheetPath   = "{$wgScriptPath}/style";
	$wgStyleSheetDirectory = "{$IP}/style";
	$wgArticlePath      = "{$wgScript}?title=$1";
	$wgUploadPath       = "{$wgScriptPath}/upload";
	$wgUploadDirector   = "{$IP}/upload";
	$wgLogo             = "{$wgUploadPath}/jungle.png";
	$wgMathPath         = "{$wgUploadPath}/math";
	$wgMathDirectory    = "{$wgUploadDirectory}/math";
	$wgTmpDirectory     = "{$wgUploadDirectory}/tmp";
	$wgPasswordSender       = "Wikipedia Mail <tsanders at synergymicro.com>";
	#$wgPasswordSender      = "Wikipedia Mail
	<apache at www.wikipedia.org>\r\nReply-To: webmaster at www.wikipedia.org";
	$wgEmergencyContact = "tsanders at synergymicro.com";


Next I am trying to use the RewriteRule in Apache.  I have the following:

RewriteEngine On
RewriteRule ^/synergypedia/(.*)$ /synergypedia/wiki.phtml?title=$1 [L]

So if I access http://sledge/synergypedia/Main_Page I get the Main Page, or
http://sledge/synergypedia/New_Page I get the New Page (with the text that no
content is present for the page).  In any case all of the links on the pages
(i.e. 'Edit this page') look like the following
http://sledge/synergypedia/wiki.phtml?title=Main_Page&action=edit.  Seems ok but
when I click it I get 

	Wiki.phtml
	From Synergypedia, the free encyclopedia. 

	(There is currently no text in this page) 

Thus it is trying to find a page titled wiki.phtml.

How do I get it to not try to create a page for wiki.phtml?



-- 
====================================================
Tim M. Sanders             tsanders at synergymicro.com
Synergy Microsystems       Phone: 520.690.1709 x323
3895 N Business Center Dr. Fax:   520.690.1796
Suite 100
Tucson, AZ 85705-6906



More information about the MediaWiki-l mailing list