htaccess strangeness

I have the following entry in my .htaccess

RewriteRule ^mypicf\.gif$ myscript.php

myscript php logs the access and returns the appropriate gif. It works fine when I access in the form: mysite.com/mypic.gif

However when I tried to access by IP address (site is on typical shared CPanel hosting) using this type of url: http://w.x.y.z/~myusername/mypic.gif

...I get the error:

The requested URL /home/myusername/public_html/myscript.php was not found on this server.

Can anyone explain why this occurs? Any way around it? I'm guessing I need a dedicated IP for this???

TIA

 

 

 

 

Top