mediawiki-extensions / mw-calendar

Automatically exported from code.google.com/p/mw-calendar
0 stars 2 forks source link

404 error after saving template with mod_rewrite on #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Mediawiki is in DOCUMENTROOT/w/extension/Calendar
Calendar in DOCUMENTROOT/w/extension/Calendar
Using the instructions from the media wiki site to create short URL's:
http://www.mediawiki.org/wiki/Manual:Short_URL/wiki/Page_title_--_no_root_access

I've made the following .htaccess:
RewriteEngine On
RewriteRule ^([^/]*)$ /w/index.php?title=$1 [QSA]
RewriteRule ^/([^/]*)$ /w/index.php?title=$1 [QSA]
RewriteRule ^Special:(.*)$ /w/index.php?title=Special:$1 [QSA]
RewriteRule ^$ /w/index.php [L,QSA]

And in LocalSetting.php:
$wgScriptPath = "/w";
$wgArticlePath = "/$1";  # Virtual path
$wgUsePathInfo = true;

and

## Use the Calendar extension
require_once("$IP/extensions/Calendar/Calendar.php");

#Puts events into their own namesspace/group (not included in 'main'
searches... etc)
$wgExtraNamespaces[100] = "Calendars";
$wgExtraNamespaces[101] = "Calendars_talk";

#Puts the events into Subpages (allows a quick link back to primary calendar)
$wgNamespacesWithSubpages[100] = true;
$wgNamespacesWithSubpages[101] = true;

Normally the addresses are in the following format:
$HOST/Main_Page
as rewritten correctly
When editting templates(after clicking "events") the format is:
$HOST/w/index.php?title=Calendars:My+Calendars/My+first+calendar/4-2009%20-Templ
ate&action=edit

This doesnt get rewritten, and saving the event results in a successful
save, but I get redirected to 
$HOST/Calendars:My Calendars/My first calendar/4-2009_-Template 
(thats rewritten correctly) But this results in a 404 from the server. I
think it has to do with the Calendar extension not adhering to the rewrite
rules or the $wgArticlePath variable

Original issue reported on code.google.com by lieter.p...@gmail.com on 9 Apr 2009 at 2:07

GoogleCodeExporter commented 8 years ago
The calendar uses $wgScript to build the URL links so I can safely say your 
assumption is correct. I dont have checks in place for short URLs using the 
no-root 
method.

You may try changing the following around line 1179. This sets the main 
calendar 
path thought out the application.
    $wikiRoot = $wgScript . "?title=";

Original comment by kenyu73 on 9 Apr 2009 at 8:10

GoogleCodeExporter commented 8 years ago
I've been playing around with that variable, the problem however is:

After saving the URL gets rewritten to $HOST/Calendar:whatever, which doesnt 
exist
according to the webserver. I think that this needs a specific var in 
Calendar.php
that checks the vars declared in LocalSettings.php, like $wgArticlePath and
$wgScriptPath. The problem is, i'm not really into programming. But i'll see 
what i
can cook up.

Original comment by lieter.p...@gmail.com on 15 Apr 2009 at 8:34

GoogleCodeExporter commented 8 years ago
When editting templates(after clicking "events") the format is:
$HOST/w/index.php?title=Calendars:My+Calendars/My+first+calendar/4-2009%20-
Template&action=edit

This doesnt get rewritten, and saving the event results in a successful
save, but I get redirected to 
$HOST/Calendars:My Calendars/My first calendar/4-2009_-Template 
------------------
The way I build the link works and saves. However, your saying that once you 
save 
the edits, MW redirects to the "correct" rewritten URL, but errors even though 
it 
shouldn't error...? Thats odd. 

I dont have the ability to re-created this as my Apache box doesn't allow me 
access 
below my wiki web root folder.

Can you confirm that "$HOST/Calendars:My Calendars/My first calendar/4-2009_-
Template" is the correct URL, but MW errors on it?

Original comment by kenyu73 on 18 Apr 2009 at 3:39

GoogleCodeExporter commented 8 years ago
I've read up on this a bit more. I don't see how AFTER the template is saved it 
would cause your 404 error. If there were a problem with the calendar "ugly" 
URLs, 
it would error before getting to the edit page.

Check the link bwlow out.. there's a few posts about using:
   $wgRedirectScript   = "$wgScriptPath/redirect.php";

http://www.mwusers.com/forums/showthread.php?t=932

Original comment by kenyu73 on 18 Apr 2009 at 4:23

GoogleCodeExporter commented 8 years ago
I've come across the source of the problem. I only saw it when i created an 
article
with "and/or" in the title. The server goes 404 when a / is in the link to the
article. So i only saw it using the calendar extension. Thanks for all the help 
:).

Original comment by lieter.p...@gmail.com on 28 Apr 2009 at 7:28

GoogleCodeExporter commented 8 years ago

Original comment by kenyu73 on 1 May 2009 at 2:15