daniel added a comment.

The current patch defines two rewrite rules:

RewriteRule ^/entity/([^.]*)$ %{ENV:RW_PROTO}://%{SERVER_NAME}/wiki/Special:EntityData/$1 [QSA]
RewriteRule ^/entity/(.*\..*)$ %{ENV:RW_PROTO}://%{SERVER_NAME}/wiki/Special:EntityData/$1 [R=303,QSA]

Requests of the form /entity/Q1234 will trigger an internal rewrite, and Special:EntityData will then trigger a 303 redirect.
Requests of the form /entity/Q1234.json will trigger a 303 redirect, and Special:EntityData will directly serve data.

This should work OK. Now we just need someone from ops to check it and merge it.

Eventually, I'd like to see a solution that uses a single rule, and adds redirect=force to the parameters for Special:EntityData. Support for this will however need to be implemented in Special:EntityData first.


TASK DETAIL
https://phabricator.wikimedia.org/T119536

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Ladsgroup, daniel
Cc: Ladsgroup, gerritbot, Esc3300, thiemowmde, hoo, elf-pavlik, JanZerebecki, Aklapper, StudiesWorld, daniel, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, Lewizho99, Maathavan, Izno, Luke081515, Wikidata-bugs, aude, fbstj, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to