Forum Moderators: phranque
I'd like to be able to add to my httpd.conf file the following functionality but try as i may i just can't even get close.
What i am trying to achieve is...
VirtualSite1 = the main site with some php programs
VirtualSite2..3..4 etc... = are slave sites that utilise the same programs but i need to post some extra vars with them.
I need tag=HTTP_HOST and id=HTTP_HOST to be sent via a rewrite as its not possible to edit the php due to support/upgrade issues.
The idea being that there is one set of php scripts that will know from Apache what tag and id have been set as it runs.
Any help on this would be most appreciated.
Thanx.. Steve :o)
Welcome to WebmasterWorld [webmasterworld.com]!
You haven't provided all the info I'd like to see, but here's something to start with:
RewriteRule .* - [ENV=tag:%{HTTP_HOST},ENV=id:%{HTTP_HOST},L]
RewriteRule ^your_script_name\.php$ - [ENV=tag:%{HTTP_HOST},ENV=id:%{HTTP_HOST},L]
Jim
I thought i had this working last night but today i've checked it again and it's not... i guess i must have had a browser cache or something as once its set once it becomes a session var so it remembers.
The rule you posted was...
RewriteRule ^your_script_name\.php$ - [ENV=tag:%{HTTP_HOST},ENV=id:%{HTTP_HOST},L]
I've tried all combinations but cant seem to get it to be queried by the php...
What i need is "any" post whatsoever to the site to have the two env vars set by default.
Any ideas?
Steve :o)
PS: I'm using Apache 2.0 nit sure if this makes a diff?