.htaccess found in /wp-content/uploads/gravity_forms

I want to give GF tech support access to a log file located in “wp-content/uploads/gravity_forms/logs/” via https (e.g. “https://yaddayadda.com/wp-content/uploads/gravity_forms/logs/ajumbledmixofcharacters.txt”) but they’re constantly getting blocked because of an .htaccess file that’s located in the parent of this directory.

I’ve tried renaming this .htaccess file, but apparently there’s a cron file or some other scheduled task that recreates it regularly.

Within the .htaccess file itself are the instructions…

# BEGIN Gravity Forms
# The directives (lines) between "BEGIN Gravity Forms" and "END Gravity Forms" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
# Disable parsing of PHP for some server configurations. This file may be removed or modified on certain server configurations by using by the gform_upload_root_htaccess_rules filter. Please consult your system administrator before removing this file.

I am not familiar enough with filters to know what to do with this instruction. Can anyone provide input on what kind of instruction needs to be put where so that I can open up access to that logs directory via the filter referenced above?

My apologies to the forum. I’m guilty of not researching better before I posted. The answer, it seems, is explained in the GravityForms online documentation found here.

I added the following to the functions.php file of my theme.

add_filter( 'gform_upload_root_htaccess_rules', '__return_false' );

I don’t know how often these files get regenerated, so I don’t know if the “fix” worked. If not, I’ll follow up again. Otherwise, it’s the work-around I was seeking.

I’m answering my own question in case anyone else runs into the same issue.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.