SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast AimyThomas's Avatar
    Join Date
    Sep 2011
    Posts
    46
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Blocking PHP files with HOSTS file?

    I add a lot of custom entries to my windoze HOSTS file to "enhance" my browsing and web-surfing experience.

    Something that I'm finding is that when I browse to certain web-sites, my browser is poping up a window asking me if I want to save the file X.php, where X is usually "like" or "likebox". When I look at the underlying web-code on the web-page, I see that the request for the php file is associated with a host that is in my HOSTS file. When I tell my browser to Save the file, I end up with a file of zero size.

    Is this the expected behavior for a browser when it tries to get a php file from a blocked host?

    Is it more trouble than it's worth to run a local web-server to serve up (or server-side-run?) an empty php file?

  2. #2
    SitePoint Guru bronze trophy TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    988
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    I don't see how the browser would get a response from the host in order to know enough to try to download the file. Are you pointing these to 127.0.0.1? It's likely there's something running locally which is causing this behaviour.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •