RewriteRule on img not working on hostgator

Discussion in 'General Scripting Chat' started by evilartemis, Sep 16, 2009.

  1. evilartemis

    evilartemis Junior Member

    Joined:
    May 30, 2009
    Messages:
    155
    Likes Received:
    14
    Hellos,

    I'm currently trying to work on stuffing but the following .htaccess code does not work on hostgator, but works on my locally hosted xampp webserver.

    Code:
    RewriteEngine on
    RewriteRule image.jpg http://www.google.com [L,R=301]
    On the localhost server, it works correctly and displays a broken img. But on hostgator, it still loads the image. Am I missing out on something? Thanks!
     
  2. MuonTrail

    MuonTrail Registered Member

    Joined:
    Mar 5, 2009
    Messages:
    96
    Likes Received:
    93
    Yeah, I've noticed that the way the pattern gets matched varies from server to server. This happens in a way that I've been too lazy to actually figure out.. so I usually just mess with it until it starts working. :rolleyes:

    Try something like this maybe:

    Code:
    RewriteEngine on
    RewriteRule .*/image.jpg$ http://www.google.com [L,R=301]