I have a question related to MediaWiki Short URLs. [1]
Short URLs are generally working very well. However, after wiki editors edit an article, they end up on the Long URL. For example:
https://domain-name/w/index.php?title=Article&stable=0
Is it possible that after editing a wiki page editors end up the Short URL?
Kind regards, Patrick
Hi Patrick,
You can use the rewrite engine[0], provided by server softwares. Like Apache server has mod_rewrite module[1] which allows to use .htaccess file in web root directory.
If your wiki already has a short url feature then it is already using a rewrite engine. You just need to add one more rewrite rule for editing the URL pattern.
Jay Prakash
[0] https://en.wikipedia.org/wiki/Rewrite_engine [1] https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html
On Wed, Feb 16, 2022 at 4:54 PM Patrick Schleizer via MediaWiki-l < mediawiki-l@lists.wikimedia.org> wrote:
I have a question related to MediaWiki Short URLs. [1]
Short URLs are generally working very well. However, after wiki editors edit an article, they end up on the Long URL. For example:
https://domain-name/w/index.php?title=Article&stable=0
Is it possible that after editing a wiki page editors end up the Short URL?
Kind regards, Patrick
[1] https://www.mediawiki.org/wiki/Manual:Short_URL _______________________________________________ MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
I have a question related to MediaWiki Short URLs [1] with nginx [2].
Short URLs are generally working very well. However, after wiki editors edit an article, they end up on the Long URL. For example
https://domain-name/w/index.php?title=Article&stable=0
Is it possible that after editing a wiki page editors end up the Short URL?
Config for nginx I am using: [2]
Mediawiki config: $wgScriptPath = "/w"; $wgArticlePath = "/wiki/$1"; $wgUsePathInfo = true;
Does [2] still up to date and look good? Are you using it too and after wiki editing the wiki page editors still are on the Short URL?
Could something be wrong in the nginx config? Isn't it determined by PHP/MediaWiki where it redirects to after a wiki editor made an edit?
Does [2] need an instruction "redirect /w/index.php to /wiki/"?
Does [2] already have an instruction "redirect /w/index.php to /wiki/", which one is that?
If PHP/MediaWiki sends the wiki editor's browser after editing to /w/index.php, should there really be a nginx redirect to /wiki?
I am not sure a redirect from /w/index.php to /wiki is a good idea because that might break special cases such as: https://domain-name/w/index.php?title=Article&oldid=82918 ?
Could it be that the nginx config is good but something is wrong with PHP/MediaWiki for directing the wiki editor after redirecting to the long URL instead of the the short URL?
Kind regards, Patrick
mediawiki-l@lists.wikimedia.org