Set htaccess php_value for url rewrited path only-Collection of common programming errors

Okay since you cannot upgrade your Apache to latest versions here is one work-around way to get this conditional setting in place.

1 – In the DOCUMENT_ROOT Run this command to create a symbolic link of index.php as __anything.php

ln -s index.php __anything.php

2 – Put the new code in DOCUMENT_ROOT/.htaccess just below RewriteEngine On line. You overall .htaccess would look like this:

# forward all URLs starting with /admin/ to __anything.php
RewriteRule ^(admin(?:/.*|))$ __anything.php?/$1 [L,NC]

# set max_input_vars to 2000 for file __anything.php

    php_value max_input_vars 20000


# your regular Codeignitor controller code
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

PS: I don’t have CI installed so I cannot really test this with CI but otherwise I tested this and got enhanced max_input_vars value.