How to enable mod_setenvif

Discussion in 'Install/Configuration' started by Django, Aug 23, 2011.

  1. Django

    Django New Member


    Please help me to enable mod_setenvif in LiteSpeed 4. I'm using LiteSpeed with DirectAdmin.

    Thanks in advance
    Last edited: Aug 23, 2011
  2. webizen

    webizen Well-Known Member

    lsws does not support mod_setenvif directly but you can set env through rewrite rule such as:
  3. Django

    Django New Member

    Thanks. I try with htaccess file look like below

    SetEnvIfNoCase User-Agent .*iPhone.* iDevides
    SetEnvIfNoCase User-Agent .*iPad.* iDevides
    <Limit GET POST>
    deny from all
    Allow from env=iDevides
    RewriteRule (.*) - [env=iDevides:1]
    I think I was wrong in sth 'cause it didn't works
  4. mistwang

    mistwang LiteSpeed Staff

    Try rewrite rule like

    RewriteCond %{USER_AGENT} !(iPhone|iPad)
    RewriteRule (.*) - [F]
  5. Django

    Django New Member

    Thank you!

    I try with below and it works like a charm.

    RewriteEngine on
    RewriteCond %{HTTP_USER_AGENT} !(iPhone|iPad|iPod)
    RewriteRule (.*) - [F]
    By the way, how can I use mod_h264_streaming?
  6. NiteWave

    NiteWave Administrator

Share This Page