So I would like to setup a rewrite for the dev's. We do maint on a site and they want to be sure that the site is in maint before they start. I was thinking.. That is easy. Just add a rewrite to look for a cookie and the date. SO I threw this together. The part I think can be reduced is the date. I would end up with something like this
^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$
The rewrite would look something like this.
#if you hit /testing
RewriteCond %{REQUEST_URI} ^/testing.*
#allow if coockie is present
RewriteCond %{HTTP_COOKIE} !(let_me_in(Date))
#allow if you have this ip
RewriteCond %{REMOTE_ADDR} !^10\.10\.10\.10
#all other redirect to maint page
RewriteRule (.*) maintenance.html [R,L]
I am just not sure how to set the date right so that it will check to be sure you have the right one. I want to avoid people forgetting they have this cookie and then calling me. :)