When specifying /asnation=<foo> as a URL parameter, if you aren't logged in as <foo> then NS will give you a login prompt. Once you've logged in, NS directs you back to the original page you wanted to go to. However, when it does so, it re-orders all the other URL parameters (parameters being stuff like /nation=<foo>/dilemma=161/page=enact_dilemma).
When I have a userscript that matches based on a specific order of parameters, this causes problems. The original link I open is always of the same format: https://www.nationstates.net/container=*/page=enact_dilemma/choice-*=1/dilemma=*/template-overall=none/nation=*/asnation=*/t=*
I create these links with a Python script that simply formats values in, so the format doesn't change.
So far, I have encountered redirected URLs of the following 2 alternative formats:
https://www.nationstates.net/page=enact_dilemma/choice-*=1/container=*/asnation=*/template-overall=none/dilemma=*/t=*
https://www.nationstates.net/page=enact_dilemma/container=*/choice-*=1/asnation=*/template-overall=none/dilemma=*/t=*
More specifically, the following two exact urls (besides the deliberately removed token parameter) redirected after login to each of the above two formats, respectively.
https://www.nationstates.net/container=Imperial_Regiment_XIV/page=enact_dilemma/choice-3=1/dilemma=644/template-overall=none/nation=Imperial_Regiment_XIV/asnation=Imperial_Regiment_XIV/t=<censored>
https://www.nationstates.net/container=Imperial_Regiment_XV/page=enact_dilemma/choice-2=1/dilemma=161/template-overall=none/nation=Imperial_Regiment_XV/asnation=Imperial_Regiment_XV/t=<censored>
I know NS can deal with URL parameters in any order, but unfortunately, userscript matching patterns don't have that luxury. What makes these two URLs different such that they redirect to different pages post-login?