Associating a script with a CGI

Discussion in 'Install/Configuration' started by Tadeo, Dec 16, 2005.

  1. Tadeo

    Tadeo Member


    I am currently evaluating the enterprise edition for use in our web store. Could I toruble someone to explain how I can associate a script with a cgi?



    CGI App Path= /var/www/vhosts/
    (The CGI is outside of the document root)

    I need mivavm to launch whenever the sever encounters a script with the extension .mv or .mvc

    Thanks in advance
  2. mistwang

    mistwang LiteSpeed Staff

    I think your question is similar to

    You can use a rewrite rule to archive this. you need to define a CGI context like /cgi-bin/mivavm

    Then add a rewrite rule , for example

    To rewrite / to /cgi-bin/mivavm/

    lshttpd will set PATH_INFO and PATH_TRANSLATED automatically, in your script, env PATH_TRANSLATED should be the path to your script.
  3. Tadeo

    Tadeo Member

  4. mistwang

    mistwang LiteSpeed Staff

    You don't need to create a dedicate rewrite rule for each mvc script, just a generic one can handle all scripts.

    try something like:
    RewriteRule /(.*\.mvc?)$  /cgi-bin/mivavm?$1+%{QUERY_STRING}  
    To do what you want.

Share This Page