-
.htaccess issues
So, I followed the instructions for the Mod-Rewrite code dialogue box, but I am still unable to access my Wiki.
http://www.domain.com/.htaccess:
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^wiki.php$ http://www.domain.com/forums/showwiki.php [L,QSA]
http://www.domain.com/forums/.htaccess:
Code:
RewriteEngine On
RewriteBase /forums/
RewriteRule ^showwiki.php?title=(.*)$ wiki/$1 [L,R=301]
RewriteRule ^wiki/Default:(.*)$ wiki/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/(.*)?$ showwiki_proxy.php [L,QSA]
I am also using vBSEO. Are any of these rewrite rules to blame presently? Accessing my domain.com/wiki links is returning 404 errors for me.
-
If it's helpful, here are my current .htaccess rules that I am actually using. The goal is to get my Wiki accessible at www.domain.com/wiki/Article -- I have renamed showwiki.php to wiki.php per your earlier guidance.
http://www.domain.com/forums/.htaccess:
Code:
# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On
# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
RewriteBase /forums/
RewriteCond %{REQUEST_FILENAME} showwiki.php
RewriteRule ^(.*)$ $1 [L,QSA,S=1]
RewriteRule ^showwiki.php?title=(.*)$ wiki/$1 [L,R=301]
RewriteRule ^wiki/Default:(.*)$ wiki/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/(.*)?$ showwiki_proxy.php [L,QSA]
RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron)
RewriteRule ^((archive/)?(.*\.php(/.*)?)?)$ vbseo.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php [L,QSA]
http://www.domain.com/.htaccess:
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^wiki.php$ showwiki.php [L,QSA]
-
Okay, it seems that the Mod-Rewrite Generator is still not producing correct results for the kind of setup you want. I'll have to create a similar setup to fix it, but here's the correct .htaccess files in the mean time.
http://www.domain.com/.htaccess:
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^forums/showwiki.php?title=(.*)$ wiki/$1 [L,R=301]
RewriteRule ^wiki/Default:(.*)$ wiki/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/(.*)?$ forums/showwiki_proxy.php [L,QSA]
http://www.domain.com/forums/.htaccess:
Code:
RewriteEngine On
RewriteBase /forums/
RewriteRule ^wiki.php$ showwiki.php [L,QSA]
RewriteRule ^showwiki.php?title=(.*)$ http://www.domain.com/wiki/$1 [L,R=301]
-
That's an improvement, but we still have problems using those rules. Now, when I access www.mydomain.com/wiki/ I am able to get to the forumdisplay (threadlisting) of my default wiki forum (vBSEO's /forums/wiki location). However, anything appended to /wiki/ (such as domain.com/wiki/Article Name) gets automatically redirected to domain.com/forums (my main forums index). Here are the new .htaccess files that I am using following your edits:
domain.com/.htaccess:
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^forums/showwiki.php?title=(.*)$ wiki/$1 [L,R=301]
RewriteRule ^wiki/Default:(.*)$ wiki/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/(.*)?$ forums/showwiki_proxy.php [L,QSA]
domain.com/forums/.htaccess:
Code:
RewriteEngine On
RewriteBase /forums/
RewriteRule ^wiki.php$ showwiki.php [L,QSA]
RewriteRule ^showwiki.php?title=(.*)$ http://www.domain.com/wiki/$1 [L,R=301]
RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron)
RewriteRule ^((archive/)?(.*\.php(/.*)?)?)$ vbseo.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php [L,QSA]
Thoughts?
-
Another thought - do I need to be renaming my Wiki PHP file? You haven't clarified that, and I'm wondering if this is contributing to the problem. Following your earlier guidance, I renamed it from showwiki.php to wiki.php -- was that the right thing to do?
-
In domain.com/forums/.htaccess, you need to find:
Code:
RewriteRule ^((archive/)?(.*\.php(/.*)?)?)$ vbseo.php [L,QSA]
Add before:
Code:
RewriteCond %{REQUEST_URI} !showwiki_proxy.php
It's also recommended, if you're using vbSEO to rewrite your forum titles like this, that your default wiki forum's title is NOT the same as your Wiki PHP File Name. You can rename the wiki forum in your Forum Manager ("Wiki" will still be used unless you also rename the Wiki namespace). You can also use a different Wiki PHP File Name than "wiki" but keep in mind this will change the wiki's path and affect your rewrite rules.
Of course you don't have to do any of that, if you're okay with not being able to access the wiki home page (see what happens when clicking the "Wiki" navbar link here).
-
That did it! Thanks. Now I can access my wiki at www.domain.com/wiki/
A couple of follow-ups:
1. Clicking on any of my namespaces returns the forum threadlisting for that Wiki, rather than a Wiki display and a default page. Is there a step that I missed in the import/conversion process, or something else you can think of?
2. Is there any way that we can deal with error-handling for users who manually type in domain.com/wiki (minus the trailing backslash)? This returns a 404 on the current setup.
-
1. You can set a default page for each wiki forum, but you probably want to create the pages first. See this doc page: http://www.vaultwiki.org/manual/Crea...orum-Main-Page
2. You can add the following to the root .htaccess (probably should be added to the generator's output too):
Code:
RewriteRule ^wiki$ wiki/ [L,QSA,R=301]
-
Thank you! One more question:
-- I have not yet converted the Legacy BBcodes in the Wiki Article/Maintenance Tools. I assume that it's okay if I leave this for a final step once I make sure that everything else is more or less working. Is that a valid assumption for me to make?
Thank you so much, pegasus. It looks like we're well under way! I will be sure to let you know if I encounter any other issues with our Wiki.
-
Yes, you can feel free to wait to do that.
-
Great, thanks so much, pegasus. I will probably just go ahead and do those now so that I can fully uninstall NuWiki.
Thanks again for being patient and so responsive with my cranky questions!
-
All the imported stuff looks okay? Specifically, were the Books imported okay? Just want you to make sure before you remove the original data.
-
Thanks, pegasus. So far, everything looks like it imported just fine. It was very quick, too. Having one problem, though, and I think it's related to the .htaccess issues (maybe).
Next to the article title, the pulldown menu with options, the "What links here", and "Broken links" links do not work; they link to /forums/?suchandsuch URLs, which of course, are ignored by the forum. How do I fix that?
-
Also, before I forget -- is there a way to completely disable all forms of auto-linking? I don't even want the auto-linking pop-up/etc. routine loaded in any way.
-
You can disable auto-linking from vBulletin Options > VaultWiki: General Settings > Enable Auto Links to VaultWiki articles
I have continued the discussion about the broken links here: http://www.vaultwiki.org/issues/1360/
-
Sorry, it seems like I wasn't talking about Auto-Linking, but rather, the AJAX Previews (which I assume carry a performance penalty). Thankfully, it looks like I could remove those using the VaultWiki General Settings as well.