Go Back   Garayed.com > Apache Configurations
Reply
 
LinkBack Thread Tools Search this Thread Display Modes

How to mod_rewrite very short URLs for MediaWiki on Apache?
  #1 (permalink)  
Old 12-17-2007, 07:54 PM
CampMaster
 
Posts: n/a
Default How to mod_rewrite very short URLs for MediaWiki on Apache?

I would like to utilize "very short URLs", ie. without the "wiki/"
sub-directory part of the URLs.

Following a fairly standard installation of MediaWiki 1.9.3, the output
concerning short URLs was:
* PHP server API is cgi; using ugly URLs (index.php?title=Page_Title)

I thereafter configured standard short URLs, including the wiki/ path, by
the procedure documented at:
http://www.mediawiki.org/wiki/Manual...iki/Page_title

As suggested in the above article, I also moved the wiki installation
directory away from the htdocs area, although it appeared to work fine even
when it resided in the the htdocs folder. With a configuration as in the
article, URLs such as http://example.com/wiki/Main_Page became fully
functional. The entries in the server httpd.conf file and the wiki
configuration file named LocalSettings.php file were done as follows
(replacing example.com with a real domain):

1) In the Apache server httpd.conf

ServerName www.example.com
<VirtualHost example.com>
ServerAdmin campmaster@example.com
User camper
Group g1013
DocumentRoot /usr/home/example.com/htdocs
AddHandler cgi-script .cgi .pl
AddType vphp5 .php
Action vphp5 /cgi-f/vphp5

# these lines were added for the wiki short URL set-up
Alias /w/index.php /usr/home/example.com/wiki/index.php
Alias /wiki /usr/home/example.com/wiki/index.php
Alias /index.php /usr/home/example.com/wiki/index.php
Alias /w/skins/ /usr/home/example.com/wiki/skins/
Alias /w/images/ /usr/home/example.com/wiki/images/
</VirtualHost>

2) In LocalSettings.php:

## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
$wgScriptPath = "/w";
$wgScript = "$wgScriptPath/index.php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;

In trying to override the 'wiki/' directory I experimented using various
methods without fully understanding the mod_rewrite syntax. For example, I
tested by simply replacing:

Alias /wiki /usr/home/example.com/wiki/index.php

with:

Alias / /usr/home/example.com/wiki/index.php

.... while reflecting this in the LocalSettings.php wiki config file as:

$wgArticlePath = "/$1";

The server then returned the following error when viewed in a web browser:

"Not Found
The requested URL /cgi-f/vphp5/ was not found on this server."

I also found a "very short URL" manual at
http://www.mediawiki.org/wiki/Manual...d--Root_access

However, I think the above manual relates mainly to Apache 2, while the
version Apache I use is 1.3.34. Can anyone suggest a few ideas to try and
produce very short URLs by a rewrite configuration in httpd.conf on a
pre-apache2 server?

Many thanks in advance for any tips and tricks!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:34 AM.


Powered by vBulletin® Version 3.5.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
| Home | FAQ | Members List | Calendar | Today's Posts | Search | New Posts |