RewriteEngine On ## Rewrite "/wp/wp-admin/admin-ajax_action/.htm" to "/wp/wp-admin/admin-ajax.php?action=" #RewriteRule ^/wp/wp\-admin/(admin\-ajax_action)/([\w-]+)\.htm$ /wp/wp-admin/index.php?action=$2 [QSA,L] # Rewrite "/wp/wp-admin/admin-ajax.php?action=" to "/wp/wp-admin/admin-ajax_action/.htm" RewriteCond %{THE_REQUEST} (action)=([\w-]+) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .*wp\/wp-admin\/admin-ajax(.*) /wp/wp-admin/admin-ajax_%1/%2.htm?t=4 [QSA,NC,L] ###RewriteCond %{THE_REQUEST} (action)=([\w-]+) ###RewriteRule ^ /wp/wp-admin/admin-ajax_$1/$2.htm [R,L,QSD] Header set Access-Control-Allow-Origin "*"