Forum Moderators: DixonJones

Message Too Old, No Replies

How to modify rewrite condition in htaccess

         

Joe Belmaati

9:07 pm on Oct 6, 2004 (gmt 0)

10+ Year Member



I have been reading page after page on interesting mod_rewrite and trap script methods. It has been very, very interesting and very easy to implement. Today I got hit by

/_vti_bin/owssvr.dll

/MSOffice/cltreq.asp?

These are requests sent by people using IE and MS Office with the Discuss toolbar turned on. As such it doesn't seem they are trying to cause any harm. I have the following rewrite condition in my htaccess file which is what caught the request in the first place:

RewriteCond %{REQUEST_URI} ^/(MSOffice¦_vti) [NC,OR]

The Rewrite rule send the request to my trap script. How do I modify the condition so that I don't catch what seems to be innocent people who have this feature turned on? FWIW I would still like to be able to catch people who are trying to download my site with FrontPage or the like.

Any ideas?

Thank you very much. Sincerely,

Joe Belmaati
Copenhagen Denmark

jdMorgan

10:28 pm on Oct 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just put those requests into their own group, and use a rule that returns only a 403-Forbidden response:

RewriteCond %{REQUEST_URI} ^/(MSOfficeŚ_vti) [NC]
RewriteCond .* - [F]

If you use a custom 403 error page, you'll need to allow for that:

RewriteCond %{REQUEST_URI} ^/(MSOfficeŚ_vti) [NC]
RewriteCond !^path_to_custom_403_page\.html$ - [F]

Jim

Joe Belmaati

6:46 am on Oct 7, 2004 (gmt 0)

10+ Year Member



Thank you very much!

Sincerely,
Joe Belmaati
Copenhagen Denmark

Joe Belmaati

7:00 am on Oct 7, 2004 (gmt 0)

10+ Year Member



Oh, one last thing. Is it possible to send people who get caught in the above mentioned situation to an oops.html page that explains to people what happened and effectively shuts them out until they turn of the Discuss toolbar without messing up the rewrite rules for those people looking for formmail scripts etc..?

I guess what I am trying to say is; How do I redirect to a page with the [F] rule that acts as an "alternate" 403 page with less drastic meaassures than a site wide ban....