I finally managed to get the Short URLs working with my installation of MW, which is located in public_html/wikific. PHP5 is being run as a CGI module. So the Short URL loads, but as I've read if something's "not done properly" with the .htaccess file (in public_html) or the LocalSettings.php, the skins/CSS files won't properly load. Can anyone point me at what I've done wrong?
From LocalSettings.php:
$wgScript = "$wgScriptPath/index.php"; $wgRedirectScript = "$wgScriptPath/redirect.php";
## If using PHP as a CGI module, use the ugly URLs $wgScriptPath = "$wgScriptPath/wiki"; $wgArticlePath = "$wgScriptPath/$1";
$wgStylePath = "$wgScriptPath/skins"; $wgStyleDirectory = "$IP/skins"; $wgLogo = "$wgStylePath/common/images/wikific_logo.png";
From public_html/.htaccess:
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^wiki/(.+)$ /wikific/index.php?title=$1 [L,QSA]
Help? -Azurite
azurite@seventh-star.net wrote:
I finally managed to get the Short URLs working with my installation
Azurite, it will help us check your work if you will post a link to your wiki. If you cannot do that, more details as to what is going on would help.
Roger
Azurite, it will help us check your work if you will post a link to your wiki.
No problem. It's at http://seventh-star.net/wikific
I checked on the link just on a whim today, and rather than showing me a CSS-less version of my Main Page, it seems to be redirecting infinitely into the wrong directory. Based on the code snippets from my LocalSettings.php and my .htaccess (from the public_html folder), what is causing this? My wiki isn't hosted in a folder called "wiki," but that seems to be what it's looking for, for some reason. Where should I edit? -Azurite
Based on the code snippets from my LocalSettings.php and my .htaccess (from the public_html folder), what is causing this? My wiki isn't hosted in a folder called "wiki," but that seems to be what it's looking for, for some reason. Where should I edit? -Azurite
Well, this line seems a little odd to me:
$wgScriptPath = "$wgScriptPath/wiki";
$wgScriptPath = "$wgScriptPath/wiki";
I changed that to read
$wgScriptPath = "/wikific"; instead, and now I get a 404 Page Not Found error-- it's trying to use the Short URLs and the software won't let it. In other words, it's trying to load http://seventh-star.net/wikific/Main_Page and that's not working.
I was looking at the manual (http://www.mediawiki.org/wiki/Manual:%24wgUsePathInfo) and the line referenced on that page isn't in my LocalSettings.php, not even as "false," because as previously mentioned, I'm using PHP as CGI. But from what I've found there ARE ways to use Pretty URL with PHP as CGI and *NO* root access... right?
Azurite wrote:
there ARE ways to use Pretty URL with PHP as CGI and *NO* root access... right?
Yes. That is my situation, too; it works. There are several ways. Instructions at http://www.mediawiki.org/wiki/Manual:Short_URL are a little hard to untangle but my best reference.
This URL is interesting -- it works!:
http://seventh-star.net/wikific/Main_Page
(Notice that links on it however point to wrong URLs. They should point to simple http://seventh-star.net/wikific/Page_name style URLs if I understand what you want.)
And this URL informs me as follows:
http://seventh-star.net/wikific/Special:Version
MediaWiki: 1.10.1 PHP: 5.1.6 (cgi) MySQL: 4.1.22-standard ******** NOTE: My hazy recollection is PHP 5.1 does NOT PLAY NICE with MedaiWiki. Someone please confirm! ******** and you have several EXTENSIONS and HOOKS installed.
Azurite, the devil is in the details:
0) What operating system and Web server are you running on your server? Linux? Apache? What is the name of your Webhost, and Web hosting plan name?
1) Is this what you want the base URL to your wiki to be?:
http://www.seventh-star.net/wikific
(I see that currently /index.php/index.php/index.php... is looping onto that so fixing that first)
***I think*** you can fix that by changing these two lines:
$wgScriptPath = "$wgScriptPath/wiki"; $wgArticlePath = "$wgScriptPath/$1";
to:
$wgScriptPath = "wikific"; $wgArticlePath = "/$1";
***************************
2) Is this the kind of short URLs you want?:
http://www.seventh-star.net/wikific/Name_of_page
3) Is this the location of your wiki installation on your server?:
/home/you/public_html/wikific/
4) Is this the entire relevant contents of /home/you/public_html/.htaccess ?:
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^wiki/(.+)$ /wikific/index.php?title=$1 [L,QSA]
5) Do you have a /home/you/public_html/wikific/.htaccess ?
(You may want to *move* your wiki .htaccess here for efficiency; although it is working now, in its present location it routs all hits to all urls at seventh-star.net needlessly through this rewrite. You only *need* seventh-star.net/wikific hits to go through this rewrite.)
Caveat: I'm a pudding head -- anyone can do what I can do but not necessarily by following my pudding headed instructions but give it a try. The devil is in several details. Good luck!
Roger Chrisman wrote:
$wgScriptPath = "wikific"; $wgArticlePath = "/$1";
I may have above wrong. If it doesn't work, try:
$wgScriptPath = "wikific"; $wgArticlePath = "$wgScriptPath/$1";
Let us know what happens.
Roger Chrisman wrote:
Roger Chrisman wrote:
$wgScriptPath = "wikific"; $wgArticlePath = "/$1";
I may have above wrong. If it doesn't work, try:
$wgScriptPath = "wikific"; $wgArticlePath = "$wgScriptPath/$1";
Let us know what happens.
Sorry I don't know, but maybe this in LocalSettings.php:
$wgScriptPath = "/wikific"; $wgScript = "$wgScriptPath/index.php"; $wgRedirectScript = "$wgScriptPath/redirect.php";
## If using PHP as a CGI module, use the ugly URLs # $wgArticlePath = "$wgScript/$1"; $wgArticlePath = "$wgScript?title=$1";
And this in .htaccess:
RewriteEngine on Options FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ /wikific/index.php?title=$1 [L,QSA]
No I'm not trying to be unhelpfully complex. I just don't really know how it works but above works for me with PHP as CGI on Linux and Apache.
Thank you everyone for your help! I got it working-- short URLs *AND* CSS! Here's what I have in the two necessary files:
LocalSettings.php:
$wgSitename = "WikiFic";
## If using PHP as a CGI module, use the ugly URLs $wgScriptPath = "/wikific"; $wgScript = "$wgScriptPath/index.php"; $wgArticlePath = "$wgScriptPath/$1";
$wgRedirectScript = "$wgScriptPath/redirect.php";
$wgStylePath = "{$wgScriptPath}/skins"; $wgStyleDirectory = "$IP/skins"; $wgLogo = "$wgStylePath/common/images/wikific_logo.png";
$wgUploadPath = "$wgScriptPath/images"; $wgUploadDirectory = "$IP/images";
.htacess:
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^wikific/(.+)$ /wikific/index.php?title=$1 [L,QSA]
For anyone that has difficulty with this on their own webspace and wants to follow similar directions, my install works as such: * PHP as CGI module * Wiki installed in its own subdomain/folder, wikific (which is in the public_html), a folder on a shared host (NO ROOT ACCESS).
Once again, thanks to everyone with all their suggestions and helpful info! -Azurite
Azurite wrote:
Here's what I have in the two necessary files:
Good stuff. You should post this on the Talk page for the Short URL help page on mediawiki.org so it's documented for others. I am _certain_ others will appreciate it - questions about this have shown up on the mwusers forum.
Mike
Michael Daly wrote:
Azurite wrote:
Here's what I have in the two necessary files:
Good stuff. You should post this on the Talk page for the Short URL help page on mediawiki.org so it's documented for others. I am _certain_ others will appreciate it - questions about this have shown up on the mwusers forum.
Mike
Mike, so true. Azurite, please do.
The mediawiki.org Short URL[1] page is now very long and unmaintainable. So I have created a *Short URL overview[2]* page with links to discrete Short URL/solution subpages (to be written by you). A separate Short URL/subpage per solution format will keep these *important* Short URL how tos, at least a core set of them, readable and maintainable.
Azurite, Mike, everyone, please come help write these mediawiki Short URL/solution how-to subpages. Each environment is different and many solutions deserve their own subpage. Please help write them, everyone, at least one documenting your own Short URL solution.
[1] http://www.mediawiki.org/wiki/Manual:Short_URL [2] http://www.mediawiki.org/wiki/Manual:Short_URL_overview <--here
Mediawiki docs needs your Short URL solution. (And you will need it again someday, too.)
Thanks!
Roger
I posted my solution from here on the Manual: Short URL talk page already, but I'll be glad to add/move it to the overview/overview talk page if that's a better place for it. But I've just been told that the solution is not 100% complete:
On one of my Wiki pages (http://www.seventh-star.net/wikific/Shizuka_Kawai), the links out (to other pages in the Wiki) are for some reason looking for http://seventh-star.net/wiki/ArticleName, which is not my directory (wiki is not; wikific is). I don't know why it's looking for this. Oddly enough, when I go to edit the page, in the preview that shows above the edit box, the links are correct when I hover over them AND when I click on them!
Does anyone have an idea as to why this may be, if my settings (from previous emails) in .htaccess and LocalSettings.php were fine enough to load everything properly? What a mystery! -Azurite
Was supposed to be released a couple of weeks ago. What happened? Is there a release candidate available (aside from going through the drudgery of subversion)? The suspense is killing me.
Sincerely,
Sven
--------------------------------- Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV.
When there is a release candidate, it will be announced here and you'll see it on mediawiki.org Regards,
On 9/3/07, Metaspheres metaspheres@yahoo.com wrote:
Was supposed to be released a couple of weeks ago. What happened? Is there a release candidate available (aside from going through the drudgery of subversion)? The suspense is killing me.
Sincerely,
Sven
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Azurite wrote:
I posted my solution from here on the Manual: Short URL talk page already, but I'll be glad to add/move it to the overview/overview talk page if that's a better place for it. But I've just been told that the solution is not 100% complete:
On one of my Wiki pages (http://www.seventh-star.net/wikific/Shizuka_Kawai), the links out (to other pages in the Wiki) are for some reason looking for http://seventh-star.net/wiki/ArticleName, which is not my directory (wiki is not; wikific is). I don't know why it's looking for this. Oddly enough, when I go to edit the page, in the preview that shows above the edit box, the links are correct when I hover over them AND when I click on them!
Probably just a cache issue. The links on http://www.seventh-star.net/wikific/Shizuka_Kawai look fine to me and work fine for me.
If you still have trouble with that, you could go to the problem page, click its history tab, change "action=history" on the end of the URL to "action=purge" and hit Enter. That helps clear some stuff up sometimes. No sure what technically happens, but it refreshes cached stuff for the page.
Roger
Out of curiosity I would be interested to know whether this configuration allows you to have pages that include an ampersand?
E.g 'Hammer & Nail'
When I tried this (using httpd.conf) I was able to create the page but when I tried to edit it I was taken to 'Hammer '. The ampersand broke the URL.
I seem to recall that the question mark symbol is problematic also.
Paul
On 9/2/07 8:24 PM, "Azurite" azurite@seventh-star.net wrote:
Thank you everyone for your help! I got it working-- short URLs *AND* CSS! Here's what I have in the two necessary files:
LocalSettings.php:
$wgSitename = "WikiFic";
## If using PHP as a CGI module, use the ugly URLs $wgScriptPath = "/wikific"; $wgScript = "$wgScriptPath/index.php"; $wgArticlePath = "$wgScriptPath/$1";
$wgRedirectScript = "$wgScriptPath/redirect.php";
$wgStylePath = "{$wgScriptPath}/skins"; $wgStyleDirectory = "$IP/skins"; $wgLogo = "$wgStylePath/common/images/wikific_logo.png";
$wgUploadPath = "$wgScriptPath/images"; $wgUploadDirectory = "$IP/images";
.htacess:
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^wikific/(.+)$ /wikific/index.php?title=$1 [L,QSA]
For anyone that has difficulty with this on their own webspace and wants to follow similar directions, my install works as such:
- PHP as CGI module
- Wiki installed in its own subdomain/folder, wikific (which is in the
public_html), a folder on a shared host (NO ROOT ACCESS).
Once again, thanks to everyone with all their suggestions and helpful info! -Azurite
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
ETA: Now it's trying to find http://www.seventh-star.net/wiki/index.php/Main_Page, and I don't know why. There's nothing in either the .htaccess or the LocalSettings.php that says just "wiki" when it comes to defining a path or URL. I am curious though, what is the purpose of the curly brackets in the values for some of these settings? The Manual seems to make it seem like they're necessary, but I'm not sure.
Here's my updated LocalSettings.php and .htaccess snippets:
$wgSitename = "WikiFic";
$wgScript = "$wgScriptPath/index.php"; $wgRedirectScript = "$wgScriptPath/redirect.php";
## If using PHP as a CGI module, use the ugly URLs $wgScriptPath = "/wikific"; $wgArticlePath = "{$wgScript}/$1";
$wgStylePath = "{$wgScriptPath}/skins"; $wgStyleDirectory = "$IP/skins"; $wgLogo = "$wgStylePath/common/images/wikific_logo.png";
$wgUploadPath = "$wgScriptPath/images"; $wgUploadDirectory = "$IP/images";
.htaccess:
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^wikific/(.+)$ /wikific/index.php?title=$1 [L,QSA] -Azurite
$wgScript = "$wgScriptPath/index.php"; $wgRedirectScript = "$wgScriptPath/redirect.php";
## If using PHP as a CGI module, use the ugly URLs $wgScriptPath = "/wikific";
You're using $wgScriptPath before defining it. That can't help matters...
Thomas Dalton wrote:
$wgScript = "$wgScriptPath/index.php"; $wgRedirectScript = "$wgScriptPath/redirect.php";
## If using PHP as a CGI module, use the ugly URLs $wgScriptPath = "/wikific";
You're using $wgScriptPath before defining it. That can't help matters...
I think that is why it is using "wiki" per some default defined elsewhere. Not what you want.
The $wgScript line must come *after* the $wgScriptPath line in LocalSettings.php.
Make it so.
I keep $wgScriptPath line right above $wgScript line to keep this obvious, eg:
$wgScriptPath = "...."; $wgScript = "....";
And be sure nothing else that references $wgScriptPath is above it.
Azurite wrote:
I am curious though, what is the purpose of the curly brackets in the values for some of these settings? The Manual seems to make it seem like they're necessary, but I'm not sure.
On php, you can insert a variable ($variable) into a text string and have it expanded ("The variable value is $variable Is that right?". However, under some circunsances, you need it to be into curly braces to be susbtituted.
mediawiki-l@lists.wikimedia.org