apache - .htaccess - How to set a custom header according to an environement variable? -
apache - .htaccess - How to set a custom header according to an environement variable? -
how set custom header via .htaccess according environement variable using if/else directive?
#refresh-page <if "%{env:document} == 'loading'"> header set refresh "3" </if>
i trying utilize syntax described in documentation apache 2.4
http://httpd.apache.org/docs/2.4/mod/core.html#if
test 1
according anubhava's answer
rewritecond %{env:document} ^widget$ rewriterule ^.* - [e=refresh:1] #refresh page header set refresh "3" env=refresh rewritecond %{env:refresh} ^1$ rewriterule ^.* loading.html [l]
alter env variable store 0 or 1 , can utilize header set
this:
you can use:
# set document=widget (remove if setting this) setenvif host ^ document=widget # set isdoc=1 if document == widget setenvif document widget isdoc # set header if isdoc == 1 header set refresh "3" env=isdoc
apache .htaccess if-statement
Comments
Post a Comment