How to create Short URL in Mediawiki without getting an 403 Forbidden Error in Apache?
My httpd.conf:
#### Wikibase (BETA)
<VirtualHost *>
ServerName wikibase.isc
ServerAlias wikibase.isc
ServerAdmin [email protected]
DocumentRoot "C:/Server/Apache24/htdocs/inc.isc/farm/mediawiki/wikibase"
</VirtualHost>
My MediaWiki's local project name is "wikibase" (with a local dns adress: http://wikibase.isc/).
I use following code for the LocalSettings.php file (located in C:\Server\Apache24\htdocs\inc.isc\farm\mediawiki\wikibase\w
):
$wgScriptPath = "/w";
$wgServer = "http://wikibase.isc";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
I also create an .htaccess file in C:\Server\Apache24\htdocs\inc.isc\farm\mediawiki\wikibase
:
## http://www.mediawiki.org/wiki/Manual:Short_URL/Apache
# Enable the rewrite engine
RewriteEngine On
# Short url for wiki pages
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
I get an 403 Forbidden Error in my Firefox Browser from my local Apache Server 2.4:
Forbidden
You don't have permission to access /C:/Server/Apache24/htdocs/inc.isc/farm/mediawiki/wikibase/w/index.php on this server.
EDIT:
My new httpd.conf code:
#### Wikibase (BETA)
<VirtualHost *>
ServerName wikibase.isc
ServerAlias wikibase.isc
ServerAdmin [email protected]
DocumentRoot "C:/Server/Apache24/htdocs/inc.isc/farm/mediawiki/wikibase"
</VirtualHost>
<Directory "C:/Server/Apache24/htdocs/inc.isc/farm/mediawiki/wikibase/wiki/">
Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
My Apache server.log file:
[Sun Jan 10 14:40:47.547054 2016] [core:error] [pid 6260:tid 1052] (20023)The given path was above the root path: [client 127.0.0.1:8634] AH00127: Cannot map GET / HTTP/1.1 to file
[Sun Jan 10 14:40:49.665828 2016] [core:error] [pid 6260:tid 1052] (20023)The given path was above the root path: [client 127.0.0.1:8634] AH00127: Cannot map GET / HTTP/1.1 to file
[Sun Jan 10 14:40:51.601607 2016] [core:error] [pid 6260:tid 1052] (20023)The given path was above the root path: [client 127.0.0.1:8634] AH00127: Cannot map GET / HTTP/1.1 to file
My Apache access.log file:
127.0.0.1 - - [10/Jan/2016:14:40:49 +0100] "GET / HTTP/1.1" 403 381
127.0.0.1 - - [10/Jan/2016:14:40:49 +0100] "GET / HTTP/1.1" 403 381 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0"
127.0.0.1 - - [10/Jan/2016:14:40:51 +0100] "GET / HTTP/1.1" 403 381
127.0.0.1 - - [10/Jan/2016:14:40:51 +0100] "GET / HTTP/1.1" 403 381 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0"
Other resources
These resources were not helpful: