openwebwork / webwork.maa.org

Information about the webwork.maa.org server
0 stars 0 forks source link

the new wiki has an extra index.php segment #31

Closed mgage closed 4 years ago

mgage commented 4 years ago

https://webwork.maa.org/wiki/index.php/WeBWorK_Main_Page

It would be better if the index.php segment wasn't there (as per the old behavior)

mgage commented 4 years ago

This might be a bit involved to fix. It uses rewrite rules. The instructions seem a little more complicated than really necessary -- which probably means I don't understand the situation

https://www.mediawiki.org/wiki/Manual:Short_URL/Apache

drgrice1 commented 4 years ago

I think I have this set up. I followed the directions on the page you linked. The key to getting it to work was that the actual location of the mediawiki can not be what you want it to be in the end. So /var/www/html/wiki had to be moved to /var/www/html/somethingelse. I used /var/www/html/wikireal.

Then add the lines

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

to /etc/apache2/sites-availablve/000-default-le-ssl.conf, and edit /var/www/html/wikireal/LocalSetings.php to have

$wgScriptPath = "/wikireal";
$wgArticlePath = "/wiki/$1";

I wanted to use /var/www/html/mediawiki as the actual location, but you currently have another version of the wiki at that location. Should I move that? Or would you prefer a different location for the real wiki?

mgage commented 4 years ago

Thanks Glenn. The current html/mediawiki has I think served it's usefulness. You can tgz it just for double safety and move it out of the way for now (up to /var/www for example) and then use that space.

When this has all settled down for a month let's remind ourselves to go through and clean up/delete the patches of code that are no longer necessary.

drgrice1 commented 4 years ago

That is done. I made a tar ball of the old mediawiki directory. It is located at /var/www/mediawiki-old.tgz. Then I deleted that directory, moved the active mediawiki directory there, and updated the redirects.