Score:0

In .htaccess, can I pass on "OPTIONS *" to be handled by PHP?

bm flag

I have a RewriteRule .* index.php to catch everything

Everything else seems to pass through just fine, even OPTIONS /. But Apache doesn't seem to let me handle OPTIONS *, and in fact just returns a blank 200 OK without even including an Allow header.

% curl -X OPTIONS http://localhost:8080 -i -v --request-target "*"
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> OPTIONS * HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Thu, 06 Jul 2023 00:25:39 GMT
< Server: Apache/2.4.57 (Unix) PHP/8.2.7
< Content-Length: 0

<
* Connection #0 to host localhost left intact

Does anyone have any clue whether it's even possible, and if so how to let the asterisk option through, or even just somehow identify it so I can have it reply with the correct set of Allow methods (in .htaccess, not the config)?

I have googled for a whole day, but searching for the keywords options and * is an exercise in futility, as you may imagine.

EDIT: For clarity, I will add that infrastructure methods such as CONNECT and TRACE are not passed on. I suspect OPTIONS * is in the same boat of requests that are handled before it even gets to the .htaccess, although it should not necessarily be, because the server doesn't know which methods are supported by scripts (hence why I want to specify them directly, if not in script then in the htaccess).

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.