I am tweaking WordPress to understand it better, play with it. For personal purposes.
But loading custom files from the /wp-includes folder won't work.
I tried to add a info.php file under /wp-includes containing phpinfo()
and when I try to access it in the browser via example.com/wp-includes/info.php
, the server returns error 503.
The folder permissions are set to 775 and the file permissions to 644.
Important note: If I rename the wp-includes
folder to something else, like wp-include
, then it works!
I contacted the hosting support to ask if they added some kind of protection but they say they did not, they say: "It's how WordPress is designed, it doesn't allow to modify files".
There isn't any .htaccess file in that folder. And the root htaccess file contains the following:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# Protect WP Config
<Files wp-config.php>
order allow,deny
deny from all
</Files>
How can I get to the reason for that 503 error. A PHP file with just plain text won't work either.
wp-includes
directory? It could be possible that your host is preventing the execution of scripts called directly from that directory since that basically never happens under normal circumstances. Does it run okay from within thewp-admin
directory?wp-includes
folder, and modifying core itself is a major anti-pattern. If your goal is to learn, filters and hooks can let you do that from the plugin and theme folders