Sunday, July 3, 2016

Using Apache Environment Variables to set custom ErrorDocument

I've got a set of RewriteCond rules that test for various mobile devices and then set environment variables like "env=device:.iphone" or "env=device:.smartphone" if the useragent matches an iPhone or Android device.



I'm trying to now redirect the user to custom-styled 404/500 server error pages for each device, by way of the error pages.



Ideally I'd like to be able to test for a variable being there, and then write in a custom ErrorDocument string. But an apache doesn't seem to work in this case.




Any ideas how I can construct if/else tests in an apache conf file for environment vars?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...