AJAX JQUERY POST 302 response

We have 2 different domain URL Rest endpoint, Any post to the URL www.firstdomain.com/getFees forwarded to www.seconddomain.com/getFees using .htaccess rewriterule.

If the post generated from HTTP Client .NET/JAVA objects works fine, but when I post the request through JQUERY AJAX POST method  getting 302 response with  page not found error. Any pointers to resolve this issue appreciated.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
It should be transparently followed

Are the two domains both on the same protocol both http or both https?

Is there a reason you are not going directly to the seconddomain.com?

According to the spec - 302 / 301 redirects are handled by the browser not the library.

This sample demonstrates how a jQuery AJAX call successfully returns the redirected page.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JRR75Author Commented:
both http, first one is on linux based and second one is in windows.  It's a post to REST services endpoint.
Julian HansenCommented:
The redirect should be handled by the browser - can you check if the sample I posted works for you in the browser you are using.

Have you tried in a different browser?
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

JRR75Author Commented:
Tried your sample in both Chrome and IE nothing happening.
Julian HansenCommented:
Did you type t1050.php into the box labelled Enter url to redirect to and then tab out of the box (move focus somewhere else)?

JRR75Author Commented:
yes i can see your sample working. How to post the data to t1050.php?
Julian HansenCommented:
Are you are getting redirected from the originating domain to a different domain? If so you are probably running foul of the same domain policy and would need to look at a solution using CORS / JASONP
JRR75Author Commented:
In fiddler i don't see the redirection from originating domain to a different domain, let me try with CORS/JASONP.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.