0

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 /
RewriteCond %{REQUEST_METHOD} ^(CONNECT|OPTIONS)
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

Anyone?

  • is mod_rewrite loaded? you can check it with "apache2 -M" command – Valerio Minetti Nov 20 '13 at 13:08
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.