Table des matières

.htaccess

Ci-dessous, un exemple de fichier .htaccess que vous pouvez copier dans votre répertoire “api” pour que chaque appel WS soit traité par le WISERVICE.

Dans l'exemple, vous devez uniquement remplacer

  • la valeur {WIAPP} par la clé de votre wiapp (fichier FWI.APP)
  • La valeur {w3hostname} par le w3hostname de votre wiapp
Options +FollowSymlinks
RewriteEngine On
RewriteBase /api/

# Si w3hostname & w3exec manquants => on ajoute par defaut
RewriteCond %{QUERY_STRING} !(w3hostname)
RewriteCond %{QUERY_STRING} !(W3HOSTNAME)
RewriteCond %{QUERY_STRING} !(w3exec)
RewriteCond %{QUERY_STRING} !(W3EXEC)
RewriteRule ^wi-app/?(.*) /wiapp/$1?w3exec={WIAPP}&w3hostname=DEFAULT [QSA,L]

# Si w3hostname manquant => on ajoute un par défaut
RewriteCond %{QUERY_STRING} !(w3hostname)
RewriteCond %{QUERY_STRING} !(w3hostname)
RewriteRule ^wi-app/?(.*) /wiapp/$1?w3hostname={w3hostname} [QSA,L]

# Si w3exec manquant => on ajoute un par défaut
RewriteCond %{QUERY_STRING} !(w3exec)
RewriteCond %{QUERY_STRING} !(W3EXEC)
RewriteRule ^wi-app/?(.*) /wiapp/$1?w3exec={WIAPP} [QSA,L]

#----------------------------------------------------------------------
# PARTIE AUTHENTIFICATION
RewriteCond %{QUERY_STRING} !(w3hostname)
RewriteCond %{QUERY_STRING} !(W3HOSTNAME)
RewriteRule ^wi-aut/?(.*) /wiapp/$1?w3hostname={w3hostname}&w3exec=WI.AUT.CTR&w3exec_app={WIAPP} [QSA,L]

RewriteCond %{QUERY_STRING} (w3hostname|W3HOSTNAME)
RewriteRule ^wi-aut/?(.*) /wiapp/$1?w3exec=WI.AUT.CTR [QSA,L]

RewriteRule ^auth/(.*) wi-aut/$1 [QSA,PT]
#----------------------------------------------------------------------


#----------------------------------------------------------------------

### Route generic, ajouter au dessus si route specifique
RewriteRule ^(.*)?(.*) wi-app/$1$2 [QSA,PT]
public/wi/installation/httpd/htaccess.txt · Dernière modification: 02/08/2023 12:59 par Jean Christophe Dewalque
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki