One Day Sec

What are some common filtering conditions usable with RewriteCond in mod_rewrite?

Common conditions include checking `HTTP_USER_AGENT`, `HTTP_REFERER`, request method, remote IP, or cookies. The article shows filtering by Referer with `RewriteCond "%{HTTP_REFERER}" "test.com" [NC]` to redirect only when the referrer matches. A full list of available variables is documented in Apache mod_rewrite documentation. These conditions allow fine-grained traffic distribution, as highlighted in the CIA Hive Beacon Infrastructure Replication 2—Implementing HTTPS Traffic Distribution Using Apache mod_rewrite follow-up.
RewriteCondHTTP_REFERERtraffic filteringHTTP headersmod_rewrite

Browse all Q&A →