From owner-freebsd-questions Thu Nov 8 7:34:26 2001 Delivered-To: freebsd-questions@freebsd.org Received: from whiterose.net (whiterose.net [64.65.220.94]) by hub.freebsd.org (Postfix) with ESMTP id 85DC437B417 for ; Thu, 8 Nov 2001 07:34:17 -0800 (PST) Received: from ccridernote (cn131426-a.harris1.pa.home.com [24.39.186.157]) by whiterose.net (Postfix) with SMTP id 5029C4B919; Thu, 8 Nov 2001 10:34:55 -0500 (EST) From: "Robert Myers" To: "'Drew Tomlinson'" , Subject: RE: Apache mod_rewrite Help Date: Thu, 8 Nov 2001 10:35:56 -0500 Message-ID: <002401c1686b$0fb257a0$0501a8c0@ccridernote> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <011001c1664c$2111b200$0301a8c0@bigdaddy> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I think you are missing the ReWriteCond, which is used in conjunction with the ReWriteRule. I had some trouble with this as well, and what I did was increase the Rewriteloglevel to 9, placed that directive, and the Engine On directive in my httpd.conf, then used a .htaccess file to do the rest. This way I could easily change the .htaccess file before moving it into my config. Also, I would assume you've checked the rewrite examples at apache.org HTH Robert Myers ccrider@whiterose.net MCSE,CCA,CCNA Systems administrator for White Rose Inernet Service http://whiterose.net -----Original Message----- From: owner-freebsd-questions@FreeBSD.ORG [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Drew Tomlinson Sent: Monday, November 05, 2001 5:50 PM To: questions@freebsd.org Subject: Apache mod_rewrite Help I'm using Apache 1.3.19 on FBSD 4.4 and am trying to redirect any GET requests that are a result of a IIS worm to an existing file on my server. I'm under the impression that the follow directives should accomplish this: RewriteEngine on RewriteLog "/var/log/httpd-rewrite.log" RewriteLogLevel 2 RewriteRule .*cmd.exe* /IIS_viri.ida RewriteRule .*root.exe* /IIS_viri.ida RewriteRule .*Admin.dll* /IIS_viri.ida where any URL contains either "cmd.exe", "root.exe", or "Admin.dll" anywhere in the string, it will be redirected to IIS_viri.ida in my ServerRoot. Shouldn't this work? To test this, I go to the URL http://www.mykitchentable.net/cmd.exe but nothing gets redirected and the following error appears in my log: 192.168.1.3 - - [05/Nov/2001:14:38:54 -0800] "GET /cmd.exe HTTP/1.1" 404 338 So what am I doing wrong? I am new so please don't assume I've done all the obvious things (although I did restart Apache :) ). Any help would be appreciated. Thanks, Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message