• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Task
    • URL rewriting to move VaultWiki to it's own base url

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: URL rewriting to move VaultWiki to it's own base url

    • Issue Tools
      • View Changes
    1. issueid=4692 July 25, 2016 11:13 PM
      Kazyyk Kazyyk is offline
      New Member
      URL rewriting to move VaultWiki to it's own base url
      How to load VaultWiki from /wiki instead of /forum/wiki

      Hello.

      I currently have a XenForo installation located at /forum. This places the wiki at /forum/wiki, which I don't think looks good at all.
      I would really like to have VaultWiki be situated at /wiki if at all possible, but I am uncertain on how to accomplish this.
      Changing the VaultWiki base settings doesn't achieve this, of course, and I've tried playing around with Apache mod_rewrite to no success.

      Any advice at all would be greatly appreciated.
    Issue Details
    Issue Number 4692
    Issue Type Task
    Project VaultWiki 4.x Series
    Category URLs / Routing
    Status Completed
    Priority 5 - Minor Bugs / Small Tweaks
    Target Version 4.0.12
    Resolved Version (none)
    Milestone (none)
    Software DependencyXenForo 1.x
    License TypePaid
    Votes to perform 0
    Votes not to perform 0
    Attachments 0
    Assigned Users (none)
    Tags url rewriting




    1. July 26, 2016 9:02 AM
      pegasus pegasus is offline
      VaultWiki Team
      If you have already changed the Wiki Base URL setting, the only thing you need is a mod_rewrite rule at / that points /wiki to /forum/index.php

      Example /.htaccess:
      Code:
      RewriteEngine On
      RewriteBase /
      
      RewriteRule ^/wiki(?:/.*)?$ /forum/index.php [L,QSA]
      If /wiki is a real folder, this may not work.

      If this does not achieve the desired effect, you will need to post or PM the mod_rewrite configuration so that we can review it.
      Reply Reply
    2. July 27, 2016 1:42 PM
      pegasus pegasus is offline
      VaultWiki Team
      Try removing the leading slashes from the RewriteRule:
      Code:
      RewriteRule ^wiki(?:/.*)?$ forum/index.php [L,QSA]
      If /forum exists and contains index.php, you should at least see a XenForo error page, not a 404.

      The wiki home page is cached. Sometimes the cache update will not propagate if an error occurs. You can clear it manually by temporarily disabling VW_CACHE_ON in /vault/config.php
      Reply Reply
    3. July 31, 2016 7:38 PM
      Kazyyk Kazyyk is offline
      New Member
      Okay, that works, but now all the CSS and /vault resources 404 as they don't exist in the root directory. Instead of looking in the /forum directory, it's checking in the root. I could copy them over, but that doesn't seem like an ideal solution.
      Reply Reply
    4. July 31, 2016 8:03 PM
      Kazyyk Kazyyk is offline
      New Member
      I was able to resolve the CSS issue with the following rule:
      Code:
      RewriteRule ^css.php(?:/.*)?$ forum/css.php [L]
      I tried the same to resolve the /vault assets issue:
      Code:
      RewriteRule ^vault(?:/.*)?$ forum/vault [L]
      However, the results in the following error:

      Refused to execute script from 'https://www.example.com/vault/resources/js/tab.js?v=4012' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
      Reply Reply
    5. July 31, 2016 9:45 PM
      pegasus pegasus is offline
      VaultWiki Team
      Code:
      RewriteRule ^vault/(.+)$ forum/vault/$1 [L]
      However, the problem with CSS and other resources sounds like a bug. VaultWiki should be aware that the resource URLs are under the forum root if the wiki root is different. I think it's using the wiki root to prevent cross-domain errors when the wiki root is a different sub-domain, but I think it should be smart enough to handle all these scenarios automatically. I will try to reproduce the issue on a test board.
      Reply Reply
    6. September 8, 2016 11:49 AM
      pegasus pegasus is offline
      VaultWiki Team
      You also need a rewrite rule from wiki-base-url/yui_loader.php to forum-base-url/yui_loader.php

      Otherwise, I have tried this in our demo (forum in /xf and wiki in /xf-wiki), and I only encountered an issue with some URLs when the "Name of the Wiki Route" setting was left blank (which does not apply to your case unless your /wiki was actually entered in the base URL setting). The bugs related to this blank setting have been fixed for the next release.

      I did not encounter any of the issues you described with broken CSS, but I see that my XenForo is serving a BASE tag in the HTML. I wonder if you are using an earlier version of XenForo that does not serve the BASE tag, or if you are using a browser that does not recognize the BASE tag.

      To avoid configuration issues in the future, I have added a new folder xf_subdomain to the do_not_upload folder. The contents of this folder would be dropped into a real /wiki folder if it does not reside at the forum root. A sample .htaccess is included in the folder as well.

      I am closing this report since all the issues I found when attempting a setup like yours are now fixed in the next release. If you have any new information to add I will gladly reinvestigate.
      Reply Reply
    7. January 27, 2017 12:00 AM
      Kazyyk Kazyyk is offline
      New Member
      I just recently revisited this and tried the new method of creating a wiki folder and using the sample contents. It ultimately ends up in a 404 error, so I went back to the current method of just using rewrites to direct everything. Just wanted to let you know, so you could see if you could reproduce it. It could be something unique to my setup, and if so, isn't really a big deal.
      Reply Reply
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 4:27 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.