Can’t get my .htaccess redirect working. (home.co.za/images/example.gif to home.html)

I know similar questions has been asked here a number of times but I simply don’t have the know-how to extrapolate a solution to my issue from that. It goes without saying that any help would be greatly appreciated.

I’m trying to redirect anyone from http://itrace.co.za/images/example.gif

to the home page: http://itrace.co.za

Here is what I have so far but nothing happens. Iv’e tried other scripts but i usually get an error.

RewriteCond %{REQUEST_URI}  ^/upload/(d+)-(.+).(png|gif|jpe?g|bmp)$  [NC]
RewriteCond %{HTTP_REFERER} ^$
RewriteRule (.*)  http://itrace.co.za/%1-%2/

That code is from another post here: .htaccess image to web page redirect?

Please help, it’s likely so simple for you experts 🙂


Source: .htaccess

1 Comment

  1. Digin Dominic

    Try this rule in root .htaccess:
    RedirectMatch 301 ^/images/.+$ http://itrace.co.za/

    Reply

Leave a Reply