Any .htaccess masters?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kektex
    Confirmed User
    • Mar 2005
    • 1813

    #1

    Any .htaccess masters?

    I need some sort of .htaccess rule which will do the following:
    I have a bunch of images in a folder that are hotlinked on other servers.I want to delete all these images and redirect all these 404`s so that instead of the hotlinkers getting a nice red X they`ll get a new image I`ll upload to my server.
    I know there is a way to do it but I don`t know how.Anyone?
    exgfmovies.com, exgfclips.com, datesx.com, gayboards.com and more!
  • BigBen
    Confirmed User
    • Nov 2004
    • 2299

    #2
    http://www.htaccesstools.com/hotlink-protection/

    Comment

    • fusionx
      Confirmed User
      • Nov 2003
      • 4618

      #3
      rewriteEngine on
      rewriteRule ^http://www.your-site.com/directory-of-images/(.*)$ http://www.your-site.com/newfile.jpg [R=301,L]

      everything after 'rewriteEngine on' should be on one line..

      Comment

      • kektex
        Confirmed User
        • Mar 2005
        • 1813

        #4
        Thanks for the help!
        Since I was planning to delete the images anyway I found a simple rule for 404`s:
        ErrorDocument 404 http://www.domain.com/newfile.jpg

        Thanks again!
        exgfmovies.com, exgfclips.com, datesx.com, gayboards.com and more!

        Comment

        • Lycanthrope
          Confirmed User
          • Jan 2004
          • 4517

          #5
          Originally posted by kektex
          Thanks for the help!
          Since I was planning to delete the images anyway I found a simple rule for 404`s:
          ErrorDocument 404 http://www.domain.com/newfile.jpg

          Thanks again!
          Not sure how much / what sort of traffic you have on that domain, but that could be a waste of valuable non-image 404 traffic. The following code will redirect image "404s" to a default image, normal "document" 404s will be treated "normally".

          RewriteEngine on
          RewriteCond %{REQUEST_URI} !-U
          RewriteRule \.(gif|jpg|jpeg)$ /your_path_to/new.gif [L]
          # the following is for normal 404s
          ErrorDocument 404 http://www.your404.com

          Comment

          • pornguy
            Too lazy to set a custom title
            • Mar 2003
            • 62910

            #6
            Oh, thanks for reminding me.
            PornGuy skype me pornguy_epic

            AmateurDough The Hottes Shemales online!
            TChicks.com | Angeles Cid | Mariana Cordoba | MAILERS WELCOME!

            Comment

            Working...