Closed Nik-EWH closed 10 months ago
Hi,
Sorry to be so late.
It's possible to fix your problem. By default, maxiGos expects that the file name ends by the string ".sgf". You can modify it using the sourceFilter parameter of maxiGos (or data-maxigos-source-filter as a script tag attribute). Its value is a regex that allows maxiGos to check if the sgf file name has a convenient format. Its default value is "^[^?]+\.sgf$". If you use a regex such as "^.*$", it will work for any file name, but a more restrictive regex can be used too (more it is restrictive, more it is secure).
For instance:
Thank you! That worked, fantastic! Not sure if I missed it but if this is not in the documentation already I suggest adding it. Very happy my project can proceed now!
Hi,
It seems that maxiGos does not work when the data-maxigos-sgf javascript attribute contains a URL with a query/parameter (e.g. www.example.com/endgame.sgf?skip_redirect=true). Is there a way to fix this?
More context: I am trying to use maxiGos to load a SGF viewer on a website any time a visitor clicks a link to an sgf file on the site.
I created a .htaccess RewriteRule to point any .sgf file to a dedicated sgf-viewer.php page template with an appended ?sgf_file=x parameter. For example, https://www.example.com/endgame.sgf will redirect to https://www.example.com/sgf-viewer/?sgf_file=https://www.example.com/endgame.sgf
The sgf-viewer.php page contains:
I added the '&skip_redirect=true' parameter because without it the .htaccess redirect would act again and rewrite the requested URL also. Then I updated my .htaccess rule with a !skip_redirect=true condition.
But, this still does not work, and when I tested it with a hardcoded example and noticed that even with the rewriterules disabled,
data-maxigos-sgf="https://example.com/endgame.sgf"
works butdata-maxigos-sgf="https://example.com/endgame.sgf?x=y"
does not.