We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

[SOLVED] Implementing MediaWiki Short URLs under Oxwall | Forum

James Geddes
James Geddes Apr 28 '15
Hi everyone,


I have been trying to follow the MediaWiki short URLs instructions but without much success. I am fairly certain that this is due to the htaccess rules that oxwall has, so I was hoping someone might be able to help me with them.

I have installed 


oxwall at example.com and
mediawiki at example.com/w 

as the above instructions recommend. I have then added these rules so that mediawiki can use its short URL format



RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L]



I am lead to believe that, along with a few extra lines in mediawiki's localsettings.php file, that should be it. Unfortunately, however, when I go to example.com/wiki oxwall shows "Page not found".


When I comment out the last line in the htaccess file


RewriteRule (.*) index.php


all traffic is redirected to the wiki with the short URL format. This shows that the wiki does work and that it does so with the intended URL format. Unfortunately, however, then one cannot access oxwall.


What am I missing here?


Thanks!

The Forum post is edited by James Geddes May 1 '15
James Geddes
James Geddes Apr 28 '15
Solved!


This was ruddy awkward to solve as it would appear that oxwall uses rather sweeping htaccess rewrite rules. Perhaps this could be improved in a future update?


Anyway, here is the solution to make MediaWiki work with short URLs under oxwall.


1. Install oxwall in the root


2. Install MediaWiki in /w


3. In your root htaccess file, add this line before RewriteCond %{REQUEST_URI} !^/index\.php


RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L,NC]


4. Add the following immediately before RewriteRule (.*) index.php


RewriteCond %{REQUEST_URI}  !^/?w(/.*)?$

RewriteCond %{REQUEST_URI}  !^/?wiki(/.*)?$



Done! That should now work.

The Forum post is edited by James Geddes May 1 '15
JoshWho
JoshWho Apr 28 '15
why didn't u just make a subdomain for your wiki? like wiki.yoursite.com
The Forum post is edited by JoshWho Apr 28 '15
James Geddes
James Geddes Apr 29 '15
1. Didn't want to.

2. MediaWiki recommends the URL format example.com/wiki/page_title.

3. I like the MediaWiki recommended format.

4. Wikipedia likes the MediaWiki recommended format - its standard & recognised.

5. The MediaWiki recommended format reduces confusion as some users might mistakenly go to example.com/page_title rather than wiki.example.com/wiki/page_title.

6. The MediaWiki recommended format reduces conflicts.

7. The MediaWiki recommended format reduces characters.

8. The MediaWiki recommended format is better for marketing purposes & easier to remember.

9. Lots of other resources on our site are available at /directoryname (/users, /blogs, /video etc) so having just the one as a subdomain would have created an inconsistent image.

10. If something is worth doing, it is worth doing properly.


Might I add that oxwall should be built in a way that makes implementing this easy, not relying solely on swathing rewrites in order to function.

The Forum post is edited by James Geddes Apr 29 '15