Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'to make it even more elegant...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
to make it even more elegant...
Authored by: Christian Leue on Apr 28, '10 10:55:10AM

To avoid the little question mark icons in the rendered web pages I do the following:

1) replace every 127.0.0.1 with 127.0.0.2 in the MKVS HOSTS file (except the entry for localhost itself, of course).

2) create a pseudo-interface 127.0.0.2 with the following launchdaemon:

[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.add_lo0_alias</string>
<key>ProgramArguments</key>
<array>
<string>ifconfig</string>
<string>lo0</string>
<string>alias</string>
<string>127.0.0.2</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
[/code]

3) add a virtual host to /etc/apache2/httpd.conf and rewrite any request to serve up 1pix.gif which is a simple 1x1 pixel transparent gif image:

[code]
NameVirtualHost 127.0.0.2
<VirtualHost 127.0.0.2>
DocumentRoot "/Library/WebServer/Documents/dummy"
DirectoryIndex index.html index.php
ErrorDocument 404 /error.html
<Directory "/Library/WebServer/Documents/dummy">
Options All -Indexes -ExecCGI -Includes +MultiViews
AllowOverride None
</Directory>
RewriteEngine On
RewriteRule ^.*$ /1pix.gif
LogLevel warn
</VirtualHost>
[/code]



[ Reply to This | # ]
to make it even more elegant...
Authored by: encro on May 01, '10 04:54:09AM

You should be able to replace each instance of 127.0.0.1 with 0.0.0.0 and then not have to worry about using Apache's Mod Rewrite as it doesn't seem to render the image.

That said I've found Glimmer Blocker to be a great solution.

---
Steve



[ Reply to This | # ]