Anyone good with mod_rewrite?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AdultWire
    Confirmed User
    • Feb 2002
    • 962

    #1

    Anyone good with mod_rewrite?

    I'm trying to write an apache config that can be included in ANY virtual host configuration by using an include statement. For some reason, this doesn't work:

    #RewriteEngine On

    #RewriteCond %{HTTP_REFERER} !^$
    #RewriteCond %{HTTP_REFERER} !^http://%{SERVER_NAME}.*$ [NC]
    #RewriteRule ^.*\.(gif|jpg|swf|css|png|jpe|jpeg|js)$ http://www.theadultwire.com/someurl.html [NC,R]

    Any ideas?
    SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.
  • AdultWire
    Confirmed User
    • Feb 2002
    • 962

    #2
    It should be noted, BTW, that it prevents *ALL* images from being downloaded, not just hotlinked images, BUT, if I hardcode a servername, it works just fine (but only for that domain).

    Any help appreciated...
    SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

    Comment

    • Pete
      Confirmed User
      • Jan 2001
      • 6617

      #3
      no
      Evoke Electronics

      Comment

      • AdultWire
        Confirmed User
        • Feb 2002
        • 962

        #4
        Really.. does no-one see anything wrong (other than the obvious fact that it's commented out?)
        SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

        Comment

        • toddler
          Confirmed User
          • Jun 2002
          • 1911

          #5
          are you finding any errors in the error log?
          apache's pretty good about bitching....
          http://www.flickr.com/photos/zoddler/

          Comment

          • AdultWire
            Confirmed User
            • Feb 2002
            • 962

            #6
            No.. I'll try running it again, but I'm pretty sure that it's not creating an error condition, it's just not doing what was expected.
            SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

            Comment

            • toddler
              Confirmed User
              • Jun 2002
              • 1911

              #7
              Do other mod_rewrite rules work?

              Look in /var/log/htttpd/error or whereever you have your stuff logging to. also may want to increase logging level, and restart apache...

              shoot me mail if you liktie and we can look into this offline...

              todd at zoomer.net
              http://www.flickr.com/photos/zoddler/

              Comment

              • spanky
                Confirmed User
                • Apr 2002
                • 231

                #8
                try using %{HTTP_HOST} instead of %{SERVER_NAME} if it's going in a VirtualHost container.

                cheers

                Comment

                • AdultWire
                  Confirmed User
                  • Feb 2002
                  • 962

                  #9
                  Thanks spanky.. I'll give that a try. I believe (unless I'm mistaken) that I started with HTTP_HOST, but I could have had something else wrong.

                  I'll let you know.
                  SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

                  Comment

                  • AdultWire
                    Confirmed User
                    • Feb 2002
                    • 962

                    #10
                    Well, no dice. No errors either (cause it seems to be a logical error, not syntactical).

                    I guess I"ll hack away at it overnight.
                    SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

                    Comment

                    Working...