Manual:Short URL

According to World Wide Web inventor Tim Berners-Lee, good webpage addresses should never change. Short webpage addresses which hide complex programming code from the webpage address bar is good for webpage visitors.

MediaWiki's default webpage addresses look like these examples:
 * (MediaWiki version 1.11.0) or

Using the methods below, short webpage addresses can be changed to addresses such as these:

How to shorten a webpage addresses gets complicated fast. So the "how to" miniguides will be on separate pages listed below.

Root access or no root access?
Shared Hosting: If you are using a shared host it is unlikely you will have root access to the server. You probably will not be able to use any of the root access techniques below. First try to open a ticket with your hosting provider. Ask the provider how to get rid of the "index.php?title=" for all pages and your hosting provider may well solve your problem for you.

If you do not have root access, the .htaccess, located in the public_html folder can be rewritten without root access. Depending on your host, you may be able to use an alias or a rewrite rule in an .htaccess file.

You only need to edit either .htaccess or httpd.conf, not both. If you have the choice, edit httpd.conf. Editing httpd.conf, which requires root access, is the preferred method because your wiki performs better. Most shared hosting systems do not allow changes to httpd.conf.


 * See the Apache article, When (not) to use .htaccess files.

Short URL "how to" miniguides
Anyone is welcome to create a "how to" solution page and list them below. Please use a sensible name for the page, one that fits in with the below names. When each unique solution has its own page, readers can skip complexity they do not want.

Keep it simple, readable, short, with a separate page per separate solution.

Example.com/Page_title
How to create: example.com/Page_title webpage addresses
 * Manual:Short URL/Page title -- PHP as a CGI module, no root access [[Image:Smiley.svg|20px]] x21 [[Image:Face-sad.svg|20px]] x3
 * Manual:Short URL/Page title -- Aliasing method--Root access [[Image:Face-sad.svg|20px]] x5
 * Manual:Short URL/Page title -- Working method with mediawiki-1.11 [[Image:Smiley.svg|20px]] x8 [[Image:Face-sad.svg|20px]]x4 used this method[[Image:Face-sad.svg|20px]] x2

Example.com/wiki/Page_title
How to create: example.com/wiki/Page_title webpage addresses


 * Manual:Short URL/wiki/Page title -- PHP as a CGI module, no root access [[Image:Smiley.svg|20px]]x3 [[Image:Face-sad.svg|20px]]x2
 * Manual:Short URL/wiki/Page title -- no root access [[Image:Smiley.svg|20px]]x6 [[Image:Face-sad.svg|20px]]x3
 * Manual:Short URL/wiki/Page title -- Both no root and root access [[Image:Smiley.svg|20px]]x2

Root access

These methods require that you have access to the server configuration. If you are on a shared host, you most likely don't; see the "no root access" examples instead.


 * Manual:Short URL/wiki/Page title--root access -- EASY [[Image:Smiley.svg|20px]]x7
 * Manual:Short URL/wiki/Page title -- with aliases--root access [[Image:Smiley.svg|20px]]x2
 * Manual:Short URL/wiki/Page title -- Apache rewrite--root access[[Image:Smiley.svg|20px]]x2 If the Alias method is not suitable (for example, you use PHP as a CGI), you can use Apache instead.
 * Manual:Short URL/wiki/Page title -- Lighttpd rewrite--root access

Wiki.example.com/Page_title
How to create: wiki.example.com/Page_title webpage addresses


 * Manual:Short URL/wiki.example.com/Page_title--difficult
 * Manual:Short URL/wiki.example.com/Page_title--Subdomain with no Subdirectory in Article URL[[Image:Smiley.svg|20px]][[Image:Smiley.svg|20px]][[Image:Face-sad.svg|20px]]
 * Manual:Short URL/wiki.example.com/Page_title--Subdomain using mod-rewrite
 * Manual:Short URL/wiki.example.com/Page_title--Subdomain using Lighttpd
 * Manual:Short URL/wiki.example.com/Page_title--Enabling a wiki using Apache Rewrite [[Image:Smiley.svg|20px]]

Ampersand (&) problem
Explanation: This problem shows up when you have page titles with symbols in (such as &, ?, #, + and /) that, despite being correctly encoded in the link are not being passed correctly from mod_rewrite to the script. This manifests in 404 page not found errors, because the title gets cut off at the special character. e.g. Clicking on a link "John & Maria's page" gets a 404, because MediaWiki is looking for a page names "John ".

Solutions:
 * Manual:Short URL/Ampersand solution with root access
 * Manual:Short URL/Ampersand semi-friendly solution with root access

Tricks

 * Manual:Short URL/IIS6 [[Image:Smiley.svg|20px]]
 * Manual:Short URL/Prevent bots from crawling index.php
 * Manual:Short URL/Ignoring the Trailing slash
 * Manual:Short URL/Allowing for escaped characters in URI

Troubleshooting

 * I received a looping alias/rewrite errors such as: 'Cannot find page www.example.com/wiki/wiki/wiki/wiki/wiki/ [...] /index.php' Solution: Manual:Short URL/Repeated directory errors
 * Manual:Short URL/Page title -- Working method with mediawiki-1.11