[Mediawiki-l] Re: Re: Re: Help for a new mediawiki installation

Kris Coryn Kris.Coryn at Pandora.be
Tue Feb 15 00:05:43 UTC 2005


Hallo Alessandro Ronchi

> Now I have a problem when editing a page:
> http://www.baseverde.it/wiki/index.php?title=BaseVerde&action=edit&section=3
> 
> I can't explain why, but it doesn't save the page.

after several times reading http://meta.wikimedia.org/wiki/Rewrite_rules and http://meta.wikimedia.org/wiki/Talk:Rewrite_rules i puzzled this thats working for me.

you have installed mediawiki not in the root of your website but in a sub /wiki (for me /var/www/localhost/htdocs/mediawiki-1.4beta6/wiki )  => http://myweb.linux.home/wiki

##### file  LocalSettings.php 

$wgScriptPath       = "/wiki";
$wgScript           = "$wgScriptPath/";
$wgRedirectScript   = "redirect.php";


$wgArticlePath      = "$wgScript$1";

##### end 

###### file apache2.conf or vhosts.conf

<VirtualHost 192.168.10.24>
ServerName myweb.linux.home
DocumentRoot /var/www/localhost/htdocs/mediawiki-1.4beta6

#close the php security hole...
php_flag register_globals off

# Allow rewriting URLs
RewriteEngine on

# fix for URLs like this: hostname.tld/?title=page_title
# if the requested page is the root page "/"
# and the query string contains the title
# return the index page, query string will be automatically appended
# RewriteCond %{REQUEST_URI} !/wiki/index\.php
RewriteCond %{QUERY_STRING} ^title=
RewriteRule ^.*$ /wiki/index.php [L,QSA]

# Don't rewrite requests for files in MediaWiki subdirectories,
# MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
RewriteCond %{REQUEST_URI} !/wiki/(images|skins)/
RewriteCond %{REQUEST_URI} !/wiki/(redirect|texvc|index|).php
RewriteCond %{REQUEST_URI} !/wiki/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !/wiki/favicon.ico
RewriteCond %{REQUEST_URI} !/wiki/robots.txt

# Rewrite http://wiki.domain.tld/article properly, this is the main rule
RewriteRule ^/wiki(.*) /wiki/index.php/$1 [L,QSA]

</VirtualHost>

#### end included file apache2.conf or vhosts.conf

### remove .htaccess

i have full access to my site so i have not tested it with a .htaccess , for this please remove it for the above test and implement later if neccesairy for  something else.

also works only for new site because otherwise you have to make some extra rules to rewrite the old links at the site.

question for other readers ?
using .htaccess mayby makes it more modulair but i don't know if this file slow down you website ?
and i where to put /var/www/localhost/htdocs/mediawiki-1.4beta6 or /var/www/localhost/htdocs/mediawiki-1.4beta6/wiki is not the same for the context of the file i think ?



Kris





More information about the MediaWiki-l mailing list