WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to build a WordPress plugin which gives out HTML for an AJAX call. However, because of the server environment I cannot use the traditional admin-ajax.php.

Someone told me that I could build a custom page using url-rewrite ex: /my-ajax-calls/

So when I send a request to that page it would be:


Then I could use param1 & param2 and give the appropriate HTML.

I know how to build plugins, how do I rewrite the URL to connect it with a method that generates the HTML?

share|improve this question
Please reformat your Q (you have wysiwyg editor buttons on top). And also please don't use dialect words like "becoz". This is a public page and not private chat. – kaiser Jan 13 '12 at 19:53

You can simply target to a custom file when using wp_localize_script(). Just - in the third argument-array - set ajax_url to whatever file you want to target.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.