简体   繁体   中英

Strange 403 error based on filename of PHP files only - rename file and it may work depending on name?

I am experiencing a strange error yesterday on a shared hosting account. I have contacted the provider, but I expect little, or at least very slow support, so I wanted to reach out to the community for some assistance.

I have some PHP files on this account that return a 403 error based on the filename along from that I can tell. For example a file name ip.php gives a 403 error, but if renamed to in.php the same file with no other change and it works. Renamed back to ip.php gives a 403 error. Renamed to ip.html or any other extention it reads, back to .php and it gives 403 error. So far I have checked and changed permissions, tried new files, blank files, and removed .htaccess files, and disabled mod_security in my cpanel so far with no change. Depending on the file name it gives a 403 error. I checked many scenarios to try and narrow it down without luck, but to give more examples I could rename the same file to 1.php or config.php and get a error, but if I rename it to admin.php it will read again, so I have not figured out a common factor yes as to what causes it to work vs not work other then it only occurs with PHP files, and it happens regardless of file permissions and contents.

Anyone experience this before? Im open to hear your suggestions or guesses as well. Thanks!

perhaps you've made a mistake in the .htaccess file, and wanted to do something like:

<Files  ~ "\.ini$">
  Order allow,deny
  Deny from all
</Files>

but instead blocked other stuff?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM