This is a URL that has nothing to do with directories. They can be mapped to directories on the server, and often this happens, but the client cannot know this for sure and does not care. URL refers to the current URL (what you see in the address bar of the browser).
So, the question is not where "CheckServer.php" is located on the server ", but" how can I access it from the client ".
If you like it:
http://example.com/alpha/index.html http://example.com/bravo/CheckServer.php
well. Use a relative URL.
But if so:
http://alpha.example.com/index.html http://bravo.example.com/CheckServer.php
then it becomes complicated. You will need to learn CORS (Cross-Origin resource sharing), since AJAX usually does not work across domains.
Oh, and if CheckServer.php is not available at all ... you can probably imagine the answer.
source share