SetEnv alternative

Discussion in 'Apache Migration/Compatibility' started by Gerry, Oct 21, 2009.

  1. Gerry

    Gerry New Member

    Since LSWS doesn't seem to support the SetEnv directive, I tried using RewriteRules to achieve the same result. However, it doesn't seem to work:

    Code:
    #
    # FLOW3 context setting
    #
    
    # Enable URL rewriting
    RewriteEngine On
    
    # Set flag so we know URL rewriting is available
    #SetEnv FLOW3_REWRITEURLS 1
    
    # You will have to enable the following option and change the path if you
    # experience problems while your installation is located in a subdirectory
    # of the website root.
    RewriteBase /
    
    # Stop rewrite processing if it is useless
    RewriteRule ^(Resources/|robots\.txt|favicon\.ico) - [L]
    
    # Continue only if the file/symlink/directory does not exist
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule (.*) index.php/$1 - [E=FLOW3_CONTEXT:Development,E=FLOW3_ROOTPATH:/web/test/xxx.tld/flow,E=FLOW3_REWRITEURLS:1]
    
    ErrorDocument 500 "<h1>Application Error</h1><p>The FLOW3 application could not be launched.</p>"
    
  2. mistwang

    mistwang LiteSpeed Staff

    It should work, you can check a phpinfo() page.
  3. Gerry

    Gerry New Member

  4. mistwang

    mistwang LiteSpeed Staff

    Well, the rewrite rule wont execute for phpinfo.php, try add a rule like

    Code:
    RewriteRule . - [E=FLOW3_CONTEXT:Development]
    at the beginning of .htaccess
  5. Gerry

    Gerry New Member

    You're right, unfortunately it still doesn't work. Is there something we might need to enable in LiteSpeed to make it work?

    I've set up a completely empty virtualhost at http://gerry.isol.be/phpinfo.php with the following .htaccess:

    Code:
    RewriteEngine On
    RewriteRule . - [E=FLOW3_CONTEXT:Development]
    
  6. mistwang

    mistwang LiteSpeed Staff

    It is in the "_SERVER[]" arrary, you wont see it in "Environment" list.
  7. Gerry

    Gerry New Member

    Gah, of course, stupid me. Thank you! :)
    Would you know why they are not visible in the environment list?

Share This Page