Score:0

htaccess php_value works only if not nested

cn flag

I have this htaccess

<IfModule mod_env.c>
    SetEnvIf Request_URI ".*/my/path/to/api.php$" IS_MY_PATH
</IfModule>

<IfDefine IS_MY_PATH>
    php_value max_input_vars 5000
</IfDefine>

in php getenv('IS_MY_PATH') returns 1 but ini_get('max_input_vars') returns 1000

I've also tried

<IfModule mod_env.c>
    SetEnvIf Request_URI ".*/my/path/to/api.php$" IS_MY_PATH
</IfModule>

<If "%{ENV:IS_MY_PATH} == '1'">
    php_value max_input_vars 5000
</If>

but doesn't work either

<IfModule mod_env.c>
    SetEnvIf Request_URI ".*/my/path/to/api.php$" IS_MY_PATH
</IfModule>


php_value max_input_vars 5000

Only in this case does it work and ini_get('max_input_vars') returns 5000 but obviously it's global, not just for ".*/my/path/to/api.php$"

Any idea why?

kz flag
Do you have any other directives in your `.htaccess` file? What is the actual URL being requested?
Daviid avatar
cn flag
@MrWhite No other directives, the full url is `website.com/htdocs/custom/my/path/to/api.php`, requested using JS with `fetch(API_URL, {method: "POST", body: formData})`
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.