Project

General

Profile

[Solved] Checking cookie's value in vhost

Added by cartpauj over 7 years ago

First I'll share the Apache Rules I'm trying to convert.

RewriteCond %{HTTP_COOKIE} cookiename=([a-zA-Z0-9]+)
RewriteCond /var/www/site.com/temp-rules/%1 -f
RewriteRule ^(.*)$ - [L]

The first condition checks for a cookie and regex's its value.
The second condition checks for a file with the same name as the value of the cookie

So I'm wondering if it's possible to convert this to a lighty equivalent?

Thanks!


Replies (1)

RE: Checking cookie's value in vhost - Added by gstrauss over 7 years ago

You can apply arbitrary conditions and file tests, such as what you are trying to do above, with mod_magnet and a little bit of custom lua code (which you write). See AbsoLUAtion

    (1-1/1)