[RESOLVED] Mangled my short URL setup: help spot my LocalSettings & htaccess errors!
I'm in the process of setting up short URLs following the Manual:Short_URL/wiki/Page_title_--_no_root_access for my private writing wiki, however I've managed to bungle it up something fierce.
The examples in the manual aren't very intuitive for non-technies like myself, so I've made a misstep somewhere along the way. I'll post my changes to the LocalSettings and htaccess; hopefully my error will be glaringly clear for your veterans. At least, I hope it will.
The wiki instillation itself, within my public html, is located in hexingtide/slug. Hexingtide I've set up as a subdomain. Not sure if that makes a difference in this.
LocalSettings
$wgScriptPath = "/slug"; # Physical path (right part of first rewrite rule).
$wgArticlePath = "/slug/wiki/$1"; # Virtual path (left part of first rewrite rule). MUST BE DIFFERENT from $wgScriptPath!
$wgScriptExtension = ".php";
.htaccess
RewriteRule ^/hexingtide/slug/?wiki/(.*)$ /hexingtide/slug/index.php?title=$1 [PT,L,QSA]
RewriteRule ^/hexingtide/slug/?wiki/*$ /hexingtide/slug/index.php [L,QSA]
RewriteRule ^/*$ /hexingtide/slug/index.php [L,QSA]
Help!
- Put the .htaccess file in the subdomain directory, not in the root directory.
- Remove the
/hexingtidefrom .htaccess - Use a virtual article path that does not match or overlap with the script path.
- For example: wgScriptPath = /slug; wgArticlePath = /wiki/$1; (articlePath without slug)
- If still problems, read Manual:Short_URL/wiki/Page_title_--_no_root_access again to see if you might have skipped a step
- Report back here :-)
I set up things exactly as you prescribed and am now getting an interesting error.
It seems the wiki is trying to run the short URLs, but when I'm directed to hexingtide.willphillips.org/wiki/XYZ, I get a 404 error (before was a 500). The hexingtide.willphillips.org/slug/index.php?title=XYZ method still works, however.
So, I'm not sure where the problem is to be found, then, but I'd guess the .htaccess as it seems like there's a redirect/rewrite issue here.
Going to try a couple of the alternate methods listed in the manual to see if I can hack together a workaround, but some help is still needed!