.htaccess modification to allow php file access in a site with WordPress

I feel like I used to be able to create a directory in a site where I have WP installed and then put some PHP files in there and access them directly. Right now, that all 404s for me despite trying a large number of .htaccess games.

You can see what happens now at https://formofawesome.com/extras/test.php

I’ve tried overriding the main htaccess file and putting an htaccess file in the extras directory but haven’t had any luck with either. Any suggestions are appreciated.

It actually doesn’t have to do with .htaccess in this case. Apache on cPanel has pretty strict permission and when a folder is too open it won’t allow the files within it to be viewable. General rule of thumb is 755 for folders and 644 for files (in your case the folder was 775). Here’s a more indepth article on permissions and how to update them via File Manager in cPanel

Should work now!

2 Likes

It’s weird but I am struggling to duplicate that at
https://experiments.middcreate.net/extras/sensus-stats/data.php

I believe the folder and file permissions are the same. I also went back and modified the .htaccess files but still no luck.

I could be incompetent but maybe not.

I couldn’t find the bad permission (it can be a pain to hunt down because even top level folders can trickle down and effect the loading of subfolders). I ran a fix permissions script we have on the server for that account and that fixed it though so definitely still a permissions thing of some kind. Here’s a relevant guide on that specifically for DoOO admins (since you need to run from WHM terminal)

Got it. Thanks Tim. Sorry for the hassle.

This topic was automatically closed after 365 days. New replies are no longer allowed.