I installed MediaWiki on my laptop. I also installed the FlaggedRevs extension, which worked. Then I implemented url shortening, and FlaggedRevs didn't like that.
My .htaccess has this:
RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d RewriteRule ^(.*)$ w/index.php?title=$1 [L,QSA] RewriteRule ^$ w/index.php [L,QSA]
My LocalSettings.php has this:
$wgScriptPath = "/w"; $wgArticlePath = "/$1"; $wgScriptExtension = ".php"; $wgUsePathInfo = true; $wgServer = "http://localhost"; $wgResourceBasePath = $wgScriptPath; $actions = array( 'view', 'edit', 'watch', 'unwatch', 'delete','revert', 'rollback', 'protect', 'unprotect', 'markpatrolled', 'render', 'submit', 'history', 'purge', 'info' ); foreach ( $actions as $action ) { $wgActionPaths[$action] = "/$action/$1"; }
So, my urls look like this:
http://localhost/Main_Page http://localhost/edit/Main_Page http://localhost/history/Talk:Main_Page etc.
All works fine, but when I try to approve a pending revision, it fails. My browser's console shows a 404 on this url: http://localhost/w/rest.php/flaggedrevs/internal/review/Main_Page
As it turns out, my wiki literally tries to load an article named "W/rest.php/flaggedrevs/internal/review/Main Page". In other words, FlaggedRevs does not load rest.php, and instead tries loading an unexisting wiki article. This of course causes FlaggedRevs to fail.
I tried hardcoding rest.php into .htaccess, explicitly instructing the server to access rest.php when asked, not a wiki page. Emphasis added:
RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d RewriteRule ^w/rest.php/(.*)$ w/rest.php/$1 [L,QSA] RewriteRule ^(.*)$ w/index.php?title=$1 [L,QSA] RewriteRule ^$ w/index.php [L,QSA]
This does not work. What am I doing wrong?