Enable CORS in wordpress

Headers manipulation should be done before template output starts. In WordPress it is typically done in template_redirect hook, which is right before template load but after core has fully loaded.

Running index.php from command line & load balancer health checks

Since wordpress’s execution logic relies on parameters filled by the php-apache connector (mod_php) running a php command line is not guarantied to produce the same results or any at all, all depending on your local settings. In any case, you should not check if your server is functioning from the server itself as there other … Read more

403 error on admin login page

I managed to enter the admin page finally! So I added these two lines to wp_admin.php: define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); afterward deleted the .htaccess file, then deleted browsing history, cleared cache and cookies. After all of this I could enter the admin page. Then I went to options/general and options/permalinks and saved the setting, it generated a … Read more

POST request not going through?

I found that it didn’t work because both endpoints used the same route. I expected defining one for POST and one for GET would result in different callbacks, but they apparently conflict with each other. In a first time, I get the request going through simply by change the namespace for the POST. Maybe there … Read more

Redirect http to https does not work on subdir where another instance of WordPress installed

I think the directive in .htaccess is inherited by subfolder The mod_rewrite directives in the root .htaccess file are not inherited by the /blog/.htaccess file (by default). You would need to specifically enable mod_rewrite inheritance, however, this probably adds unnecessary complexity. I try to modify the .htaccess under /blogs/ by adding the above directive again. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)