.htaccess SetEnvIfNoCase Help

Discussion in 'Apache Migration/Compatibility' started by manofphat, Nov 21, 2007.

  1. manofphat

    manofphat New Member

    Hello,

    I used to use the following in my .htaccess file in Apache. How would I go about writing it so it works with LiteSpeed?

    Code:
    SetEnvIfNoCase Referer hl2://xx\.xx\.xx\.xx allow_download
        Order Deny,Allow
        Allow from env=allow_download
        Deny from all
    Thank you for your time!
  2. mistwang

    mistwang LiteSpeed Staff

    You can convert it to a rewrite rule.
  3. felosi

    felosi New Member

    This is one of my customers here. Ive tried to find a substitute using rewrite rules to no avail. Would anyone happen to know the correct rewrite rule conversion for this?
  4. mistwang

    mistwang LiteSpeed Staff

    Something like
    Code:
    RewriteCond %{HTTP_REFERER} !^hl2://xx\.xx\.xx\.xx$
    RewriteRule .*  - [F]
    
  5. manofphat

    manofphat New Member

    I can still view the contents of that directory when I'm not being referred by that IP.

    Thanks!
  6. mistwang

    mistwang LiteSpeed Staff

    add "RewriteEngine on" to your .htaccess

Share This Page