I'm sure that my .htaccess file is being read by Apache as I tried to write in random stuff in it, eg: "sifnoweijf", and my page could no longer be displayed.

but why the following rewrite doesn't work?

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule .* - [R=405,L]
  • Running Apache 2.2.22 on Windows Server 2012
  • .htaccess file in DocumentRoot, eg: "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs"
  • httpd.conf is configured:

    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all


  • is mod_rewrite loaded? you can check it with "apache2 -M" command Nov 20, 2013 at 13:08

1 Answer 1


Sorry guys, the rewrite is definitely working.

As you guys can see on my rewrite condition, I'm trying to respond to the CONNECT and OPTIONS request method with HTTP respond code 405. But I'm still getting respond code 200.

The culprit is my network's configuration where the hardware load-balancer is responding on behalf of the web server.

So, having the load-balancer configured properly fixed the issue.

Case Solved

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .