V
V
Vasek19992020-10-20 16:46:20
local server
Vasek1999, 2020-10-20 16:46:20

How to set up mediawiki short addresses on local hosting?

Good afternoon everyone! There was a problem setting up the mediawiki engine on the local machine.

The mediawiki engine is installed on the remote hosting in the /w subfolder. Set up short URLs so that pages can be accessed via links like domain.com/wiki/Page_Name .

To do this, in the root directory there is an htaccess file with the following line:

RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]


In the LocalSettings.php file, short links are enabled:

$wgScriptPath = "/w";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;


This code works fine on the remote server and redirects as needed, however on the local machine an attempt to redirect it causes error 403. Tried both xampp and openserver - same error. If you disable the above line in htaccess on the local server, then the pages become available via a standard link like
domain.local/w/index.php/Page_Name .

I tried a lot of ways - everyone advises to look if mod_rewrite is enabled: I looked, it is enabled. It turns out that he just redirects incorrectly, but why is not clear. Tell me, please, how can this be corrected?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question