X
X
xxx44yyy2019-04-29 13:50:07
Search Engine Optimization
xxx44yyy, 2019-04-29 13:50:07

What response code is suitable for robots if the address is only for AJAX?

There is an address, for example this: https://example.com/page.php The thing is that it is processed only if it is an xml http request, i.e. for ajax requests. For SEO, having such an address is not very good, because when you go to it, the robot will see 404 or something like that.
Question: what is the right way to send an error code to the robot, saying that there is an address, but it works with PUT, does not work with GET?
I think the most appropriate is 405 code. What do you think?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2019-04-29
@xxx44yyy

There is a method not allowed, return it

S
Sanovskiy, 2019-04-29
@Sanovskiy

header('HTTP/1.1 404 Not Found');
exit(0);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question