Suppression "/pls/"

Accueil ] Remonter ] Suivante ]
 

Introduction

Ce document décrit comment supprimer la chaîne de caractères "/pls/" de l'url des services Web PL/SQL.

Exemple: http://lgl-ias/pls/IWD6I/per$.startup => http://lgl-ias/IWD6I/per$.startup

Mod_rewrite

Une url qui utilise la passerelle PL/SQL est construite de la façon suivante: http://nom_serveur/pls/nom_dad/nom_procedure

"pls" est un chemin virtuel qui permet au serveur Web de savoir qu'il ne doit pas traiter lui-même l'url mais qu'il doit la transmettre à la passerelle PL/SQL.

Il est possible avec le serveur Web Apache et le module mod_rewrite de donner des règles de manipulation d'url afin de convertir une url A en une url B. Dans notre cas, nous voulons convertir une url  du type http://nom_serveur/pls/nom_dad/nom_procedure en une url de type http://nom_serveur/nom_application/nom_procedure

Pour cela, il faut ajouter le code suivant dans le fichier de configuration d'Apache (httpd.conf)

# Suppression du /pls/ dans l'url
# Suppression du /pls/ dans l'url
<IfModule mod_rewrite.c>
  <IfModule mod_plsql.c>
    RewriteEngine on
    RewriteRule ^/IWD6I/(.*)$ /pls/IWD6I/$1 [PT]

  </IfModule>
</IfModule>

Voir aussi: Personnalisation ESNIG-LGL

Il existe deux instructions supplémentaires intéressantes pour débugger le travail du Rewrite Engine:

RewriteLog "D:\ORACLE\iSuites\Apache\Apache\log\rewrite.log"
RewriteLogLevel 9

Voici la syntaxe utilisée dans les règles de manipulation:

Text: 
  . 	     Any single character 
  [chars]    Character class: One of chars 
  [^chars]   Character class: None of chars text1|text2 Alternative: text1 or text2 

Quantifiers: 
  ? 	     0 or 1 of the preceding text 
  * 	     0 or N of the preceding text (N > 0) + 1 or N of the preceding text (N > 1) 

Grouping: 
  (text)     Grouping of text (either to set the borders of an alternative or for making 
             backreferences where the Nth group can be used on the RHS of a RewriteRule with $N) 

Anchors: 
  ^ 	     Start of line anchor 
  $ 	     End of line anchor 

Escaping: 
  \char      Escape that particular char (for instance to specify the chars ".[]()" etc.)

Quelques explications sur le flag [PT]:

  • 'passthrough|PT' (pass through to next handler)
    This flag forces the rewriting engine to set the uri field of the internal request_rec structure to the value of the filename field. This flag is just a hack to be able to post-process the output of RewriteRule directives by Alias, ScriptAlias, Redirect, etc. directives from other URI-to-filename translators. A trivial example to show the semantics: If you want to rewrite /abc to /def via the rewriting engine of mod_rewrite and then /def to /ghi with mod_alias:
        RewriteRule ^/abc(.*)  /def$1 [PT]
        Alias       /def       /ghi
    If you omit the PT flag then mod_rewrite will do its job fine, i.e., it rewrites uri=/abc/... to filename=/def/... as a full API-compliant URI-to-filename translator should do. Then mod_alias comes and tries to do a URI-to-filename transition which will not work.

    Note: You have to use this flag if you want to intermix directives of different modules which contain URL-to-filename translators. The typical example is the use of mod_alias and mod_rewrite

Vous trouverez de plus amples informations sur le module mod_rewrite dans la documentation d'Apache:

Vous trouverez également des informations dans la documentation officielle d'iAS 9i au sujet de la suppression du /pls/.