YunoHost-Apps / opensondage_ynh

OpenSondage for YunoHost
https://framadate.org/
GNU Affero General Public License v3.0
16 stars 14 forks source link

URL rewrite not implemented #61

Closed Salamandar closed 3 years ago

Salamandar commented 4 years ago

OpenSondage usually works with URL rewrite. That means that :

https://myserver.tld/sondage/poll_name

should redirect to

https://myserver.tld/sondage/studs.php?poll=poll_name

It's implemented by their .htaccess file, found here : https://github.com/framasoft/framadate/blob/github/htaccess.txt

  RewriteRule ^([a-zA-Z0-9-]+)$ studs.php?poll=$1 [L]
  RewriteRule ^([a-zA-Z0-9-]+)/action/([a-zA-Z_-]+)/(.+)$ studs.php?poll=$1&$2=$3
  RewriteRule ^([a-zA-Z0-9-]+)/vote/([a-zA-Z0-9]{16})$ studs.php?poll=$1&vote=$2
  RewriteRule ^([a-zA-Z0-9-]{24})/admin$ adminstuds.php?poll=$1
  RewriteRule ^([a-zA-Z0-9-]{24})/admin/vote/([a-zA-Z0-9]{16})$ adminstuds.php?poll=$1&vote=$2
  RewriteRule ^([a-zA-Z0-9-]{24})/admin/action/([a-zA-Z_-]+)(/(.+))?$ adminstuds.php?poll=$1&$2=$4

It should ideally be implemented by the nginx config file too. I tried it successfully, gonna do a PR soon.