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

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -