How to enable URL rewriting on a DD-WRT router

access-controldd-wrthttp-proxyurlweb

I would like to be able to add a parameter to certain URL requests that go through my DD-WRT router. Specifically, I'm trying to figure out how to force safe search in Google, which means I have to append safe=on to any URL requests that begin with *google*.

I've read about running a server on the router that acts as a proxy. Then on that server I could use mod_rewrite or something similar. I've also read about firewall rules using iptables. Both of these are way over my head, but I can't seem to find any real guidance on this.

Best Answer

You can't do this in a sane way for Google search queries.

Why? Google is using HTTPS (SSL) everywhere now. All traffic between the endpoints (browser & Google server) is encrypted and checked for integrity.

The only way to read (let alone modify) encrypted traffic is changing it at or beyond on one of the endpoints. Suggestions in the direction of mod_rewrite are all server-side and you probably don't have access at Google's servers. ;)

Workarounds for this like modifying your local DNS forwarder to answer differently and set up a proxy server with SSL MITM won't work either without adding your own fake CA to every browser. Moreover, using Google Chrome, it's way harder to circumvent this as Google has hardcoded fingerprint signatures to check. Refer to some news regarding the DigiNotar in 2011, for example here.

Back to your objective and the only endpoint you can control here. My suggestion would be to find a browser addon/plugin that will fit your needs and enforce it for the user. For example by modifying the file system permissions for the configuration of it to prevent the user from changing it and disallow any new software installations.

Related Question