Help with you know what

Using mod_rewrite to handle various content issues

Postby austincb » Sun Jun 15, 2008 4:20 pm

Hooray, progress!
The edit page now displays within the main site.

Using the mod_rewrite=no seems a bit inelegant to me, but after 5 days I guess I can't complain.

Only downside is that now when you click the "Save Changes" button, the stupid thing just seems to refresh the edit page and doesn't end up saving anything at all. I don't know if that's a rewrite issue though -- I'll have to tinker later.

Thanks for the help.

EDIT: On second thought, maybe if I just make the rewrite rule ignore anything that has "&action=submit" ? That way it will temporarily transfer control to mediawiki's submit code, which I believe automatically redirects to the saved page after it's done (which the rewrite rules we already have would take care of)...

EDIT #2: Okay I think I got it. I added this line:

Code: Select all
RewriteCond %{QUERY_STRING} !^(.*&)action=submit(&.*)?$ [NC]

and now it saves properly.

Phew!
austincb
 
Posts: 7
Joined: Thu Jun 12, 2008 4:21 pm

Postby richardk » Thu Jun 19, 2008 2:16 pm

Using the mod_rewrite=no seems a bit inelegant to me, but after 5 days I guess I can't complain.

You could try
Code: Select all
else if ($_GET['wiki'])
{
  echo '<div id="pageContent">';
  $_GET['title'] = $_GET['wiki'];
  include '/full/server/path/to/mediawiki/index.php';
  echo '</div>';
}

instead of
Code: Select all
else if ($_GET['wiki'])
{
echo '<div id="pageContent">';
$include = 'http://subdomain.domain.com/mediawiki/index.php?title='.$_GET['wiki'];
if ($_GET['action'])
{
$include .= '&action='.$_GET['action'];
}
include $include;
echo '</div>';
}

to include the MediaWiki PHP instead of including the result of a seperate page request.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Previous

Return to Content

Who is online

Users browsing this forum: No registered users and 18 guests

cron