inferno-prime Posted August 20, 2020 Share Posted August 20, 2020 I found a topic here That looks like it mite work. Now I did try this but I get a post 404 on the new ajax url which is /ajax/ which then I can't do anything in the dashboard. I would told the api was not meant for this but honestly I don't know what to say as long as the code works I really don't see a problem with using it. BTW I am using this code : // This will change the url for admin-ajax.php to /ajax/ function modify_adminy_url_for_ajax( $url, $path, $blog_id ) { if ( 'admin-ajax.php' == $path ) { $url = site_url('/ajax/'); } return $url; } add_filter( 'admin_url', 'modify_adminy_url_for_ajax', 10, 3 ); And this goes into the .htaccess RewriteRule ^/?ajax/?$ /wp-admin/admin-ajax.php?&%{QUERY_STRING} [L,QSA] Quote Link to comment https://forums.phpfreaks.com/topic/311351-rewrite-wordpress-admin-ajaxphp-url/ Share on other sites More sharing options...
portfox Posted June 29, 2021 Share Posted June 29, 2021 What about using the custom structure permalink in the dashboard of WP? it will rewrite it for you? Quote Link to comment https://forums.phpfreaks.com/topic/311351-rewrite-wordpress-admin-ajaxphp-url/#findComment-1587680 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.