Rewrite Configuration
This is an old revision of this page, as edited March 15, 2013, 5:22 PM by pegasus(contribs). It may differ significantly from the current revision.
When installing VaultWiki for the first time, or upgrading to VaultWiki 4 from VaultWiki 3, or if you have made changes recently to Settings: Site Config, you may need to update your server's Rewrite configuration. If you are using default values for the following settings, you can skip this step:
- Filename of the Wiki PHP File
- Wiki URL Format
Depending on what kind of software your web server uses, the configuration will vary.
Apache
Locate the /.htaccess file in your forum directory or create a new one.
Add the following to the file:
Code:RewriteEngine On
RewriteBase /
# If filename is not 'wiki_index', replace WIKI_FILE and uncomment the following line
# RewriteRule ^WIKI_FILE.php wiki_index.php [L,QSA]
# If URL format is /wiki/path or replaces a catch-all rule, uncomment the following 3 lines
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)?$ wiki_index.php [L,QSA]
NginX
Open your /etc/nginx/nginx.conf file for editing, locate the server block for the domain where VaultWiki is installed, and add the following, where /forums/ is your forum directory:
Code:location /forums/ {
# for vBulletin, uncomment the following line
# if ($request_filename != /(?:admincp|clientscript|cpstyles|install|images|modcp|cron|vbseo|vault))
# for XenForo, uncomment the following line
# if ($request_filename != /(?:admin|data|install|js|styles|vault)
{
set $redirect_url $fastcgi_script_name;
rewrite ^ /forums/wiki_index.php last;
}
}
Note: If you use vBSEO or some other method of catch-all URL rewriting, keep in mind that VaultWiki's rewrite rules should super-cede and completely replace the rules for your existing solution. You can pass URLs that VaultWiki fails to match to your catch-all script using the DEFAULT_SCRIPT directive in /vault/config.php.