开发者

400 Bad Request on Apache/PHP AddHandler wrapper

开发者 https://www.devze.com 2023-01-28 11:25 出处:网络
I\'m trying to create a wrapper/handler that will be called on the Apache server whenever someone requests any PHP script inside of a directory. That way I can authorize users for the entire directory

I'm trying to create a wrapper/handler that will be called on the Apache server whenever someone requests any PHP script inside of a directory. That way I can authorize users for the entire directory or write some other stuff to be called when the directory is called.

This is the best configuration I've been able to come up with...

 <Directory "/srv/http/INNOV/PUBLIC_HTML">
  Options -Indexes
  AllowOverride All
  Order allow,deny
  Allow from all

  DirectoryIndex index.php
 </Directory>

Then in /srv/http/INNOV/PUBLIC_HTML/kb/ I have this .htaccess file...

Options -Indexes

AddHandler auth_handler .php
Action auth_handler ../auth_handler.php

Then in /srv/http/INNOV/PUBLIC_HTML/kb/auth_handler.php is as follows...

<?php
$FILE = $_SERVER['PATH_TRANSLATED'];
echo $FILE;
?>

Access Log:

  - - [02/Dec/2010:17:43:15 -0500] "GET /kb/index.php HTTP/1.1" 400 590

Error Log:

[Thu Dec 02 17:50:19 2010] [erro开发者_JAVA百科r] [client XXX.XXX.XXX.XXX] Invalid URI in request GET /kb/ HTTP/1.1

I've checked my browser and it seems to be making a proper request.


nvm, all I had to do was remove the ../ in the htaccess file. DUR! Apologies.

0

精彩评论

暂无评论...
验证码 换一张
取 消