Is it possible to use an alternative ajax url instead of /wp-admin/admin-ajax.php ? The backend_ajaxurl for ASP is /wp-admin/admin-ajax.php. Can I change that? It is fine for our development environments, but when we deploy to our QA and PROD environments which are on www domains we block any access or requests to /wp-admin/ for security reasons. Is there a php hook, snippet, or anything I can do with ASP to change the backend_ajaxurl ? Or point me to some docs for some help? I’ve been looking into some ways to do, but I wanted to reach our to you first. Thanks.
I would not recommend doing that whatsoever, as the ajax URL is a wordpress core feature – all the plugins, as well as the wordpress core is using that. Unfortunately I don’t know if that is possible to change securely, I would not recommend moving that file though, or blocking public access from it. You could maybe try blokcing the rest of the folder, and make an exception to it somehow.
Thanks for that info. Is it at least possible to create a WordPress hook to change the value of "admin_url" => admin_url(), or make it relative so it doesn’t use an absolute URL?
I guess there is a hook somewhere. Check the source of the get_admin_url, there might be something there. But again, I really don’t recommend tempering with these URIs if possible.
I fixed the issue we were having. It was a CORS Policy cross domain issue. No need to try to hack something together. Everything is working correctly now. Thanks for your info.