I have two files as follows:
- one.php
- two.php
Code for one.php
<?php
header( 'Location: two.php' ) ;
?>
Code for two.php
<?php
echo 'Hello Two' ;
?>
I wish to implement the following:
- When a user access one.php using the http GET method, he/she should get a basic Auth prompt (401)
- When a user access one.php using the http POST method, he / she should get the 405 - Method Not Allowed.
- When a user access one.php using the http HEAD method, he / she should get the 302 Found.
I can implement the (1) and (2) with the help of .htaccess. However, since Apache consideres GET and HEAD as one, I am unable to implement (3). Is there any way I can implement the above scenario in Apache so that I can differentiate between GET and POST and configure .htaccess separately.