homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Blocking IPs with an image and htaccess?

5+ Year Member

Msg#: 3268750 posted 7:55 am on Mar 2, 2007 (gmt 0)

I want to be able to block certain IP addresses from viewing a webpage. The problem is that for this particular webpage (site A), only html is allowed. I don't know of any way to block IPs by using html. I thought maybe I could create a rule in htaccess on another website (site B) that would allow me to block the IPs on site A.

I've already created something in htaccess that allows me to track IPs on site A by putting an image on the webpage. Is there a way to block users from the webpage by inserting an image on the webpage? From what I already tried, only the image is affected, not the webpage. It doesn't seem like it's even possible but I was hoping someone would know for sure.



10+ Year Member

Msg#: 3268750 posted 2:39 pm on Mar 2, 2007 (gmt 0)

If you have access control over site B but not site A -- make the content you want to restrict come from site B -- you can do this by using either iFrames or JavaScript codes on site A to include content that will be retrieved from site B and this be subject to any .htaccess rules you set up on site B. JavaScript would be more transparent than iFrames because if the SCRIPT SRC tag ref is denied, the browser will just show nothing, opposed to to an iFrame SRC which will display the error (you can tweak both with a redirect though).

On site B, the .htaccess code can also just redirect the "good" visitors to the good content on site A and redirect the "bad" ones to something else on site A or B, or anywhere else.


5+ Year Member

Msg#: 3268750 posted 4:39 am on Mar 3, 2007 (gmt 0)

It seems that the script and iframe tags are not allowed on site A. Something else that I was going to try was to create an external stylesheet located on site B and link to it from site A. But site A doesn't allow the link, import, or meta tags.


WebmasterWorld Senior Member wilderness us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Msg#: 3268750 posted 6:51 pm on Mar 3, 2007 (gmt 0)

The best solution is to ditch "Site A" and get consign an effective host without restrictions.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved