tags:

views:

145

answers:

2

I'm doing an jQuery ajax call to an XML page in my CakePHP site. For some strange reason CakePHP returns a 404 error when I do an ajax call, yet there is no problem going to the URL directly at http://imgfave.com/gragland/rss.

You can see the issue by clicking the link on my test page: http://imgfave.com/ajaxtest

The error page says: "The requested address '/gragland/rss' was not found on this server".

Why would CakePHP have a problem returning the page only when fetched via ajax?

+2  A: 

According to FireBug, the main difference between the requests is:

X-Requested-With XMLHttpRequest

From AJAX request.

P.S.: After a quick test using the same headers, it retrieves the RSS without error

Ast Derek
Thanks, removing X-Requested-With header did the trick.
makeee
A: 

Im having same issue as this but I dont have any difference with that particular header, only one I have different is:

Accept application/json, text/javascript, / (404 Error)

Accept / (No Error)

How would I go about removing those headers to see if it makes a difference?

Kevin