Manual:Wiki in site root directory

It is possible to use the root directory of a domain as the wiki directory and have the URLs look like this: "example.com/Page_title", but it is NOT recommended.

GuidesEdit

See the manual on short URLs.

ConsiderationsEdit

  • Potential need for special rules.
    • You might need special rules for "robots.txt" or "favicon.ico", also for all wiki support files like skin images, extensions that load content from the "/extensions/" folder (such as CSS, JS, or images), and root scripts like api.php, thumb.php, and image_auth.php. This is all compatible with having your wiki in your website's root directory.
    • On the other hand, you might not. For instance the following in .htaccess on an Apache server seems to allow existing files and directories to be accessed as normal:
      RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
      RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
      RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php [L]
      
  • Periodically bugs pop up with various configurations and root URLs because MediaWiki was not designed for them. These are being tracked in task T34620; currently these are the outstanding issues:
    • task T34621, a root action path completely overrides $wgActionPaths.
    • task T40048, root article paths allow bypassing of nofollow and attacks on Special:Random.
    • task T113160, Super-short URLs are formed incorrectly for articles with titles starting with a slash.
  • There are a lot of bots scanning random websites searching for known vulnerabilities to exploit, usually performing checks against a list of known URL paths, and they usually request many URLs without delays between them. If your pages start at the root directory, this means each request will hit MediaWiki instead of a plain HTTP 404 error page, which means they will put more strain on your server.
  • Any scheme which does this is not supported by the MediaWiki developers. Use the configuration used by Wikipedia if you want to be on the safe side.