Check if a file that corresponds to a URL exists
int Ns_UrlIsFile( char *hServer, char *URL );
The Ns_UrlIsFile function constructs a file name by appending the URL to the current AOLserver pages directory for the specified virtual server. It returns 1 if the file exists and is a regular file.
/* IsFile - Simple request to determine if an URL is a file. */ int IsFile(Ns_Conn *conn, void *ctx) { int isfile; char *server; server = Ns_ConnServer(conn); isfile = Ns_UrlIsFile(server, conn->request->url); if (isfile) { Ns_ConnReturnNotice(conn, 200, "File", NULL); } else { Ns_ConnReturnNotice(conn, 200, "Not a File", NULL); } return NS_OK; }