Everybody Staze...

Nobody leavz...

  • Home
  • About Me
    • LinkedIn
    • Lab
  • Contact
  • Links
  • Reviews
  • Sitemap
  • Weather
You are here: Home / Sys Admin / iOS (and possibly Android) Chrome .htaccess allow

iOS (and possibly Android) Chrome .htaccess allow

2015/01/07 By staze

google-chrome-for-iosI have a couple websites I limit access to with apache .htaccess files. I also use Google Chrome on my iPhone, and for some reason, it was being blocked even though I specifically allow my internal subnet. Looking at the logs, I saw the request was coming from IP 66.249.84.145, or google-proxy-66-249-84-145.google.com. Ah! There’s a Data Saver feature in Chrome on iOS (guessing it’s there for Chrome on Android too). The iOS Chrome uses a Google proxy to download the webpage, do some compression/minification/etc, and then send it to the phone. They call this “Data Compression Proxy“. According to the App, it saves me about 20% of my data (which, I don’t care about when on Wifi, but on cell, it’s not a bad idea).

Anyway, you have to add a few lines to a .htaccess file to make this work right. In my case, I had the following in my .htaccess:

Order deny,allow
Deny from all
SetEnvIf X-Forwarded-For "^123\.123\.123\.123" AllowAccess
SetEnvIf X-Forwarded-For "^123\.123\.*\.*" AllowAccess
Allow from 123.123.0.0/16
Allow from 123.123.123.123
Allow from 127.0.0.1
Allow from env=AllowAccess

The important lines are the “SetEnvIf” lines. These basically set a variable/flag in Apache to the value passed in X-Forwarded-For, which is set by a Proxy Server (in this case, the Google one). Then the last line basically says “Allow anything that has the variable “Allow access” set”. The only odd thing in my case is that my iPhone seems to default to connect over IPv6, so I had to add a SetEnvIf line for my IPv6 subnet.

Good luck!

Print Friendly, PDF & Email

Filed Under: Sys Admin Tagged With: .htaccess, Google Proxy, X-Forwarded-For

Weather

Categories / Archives

  • Apple
  • Coding
  • Electronics
  • Energy
  • Home Ownership
  • Miscellany
  • Politics
  • Prius
  • Sys Admin
  • Travel
  • Uncategorized
  • Work
  • June 2026
  • April 2026
  • August 2025
  • April 2025
  • January 2024
  • February 2021
  • July 2020
  • January 2020
  • April 2019
  • March 2018
  • February 2018
  • June 2017

Copyright © 2026 · Staze On Genesis Framework · WordPress · Log in