Make Apache return simple message for specific url

Solution 1:

Without any file existing on the server? No. Apache is a great web server, but that's really all it does - serve files (or dynamic content through modules, but the concept is essentially similar). A quick read of the mod_rewrite documentation seems to indicate that something like this:

RewriteRule ^/someurl - [R=204]

should respond to a web request with a "success, no content" HTTP status code. Not exactly what you're after, but might do the trick.

Solution 2:

Rewrite the specific url to i.e. succes.php:

RewriteCond %{REQUEST_URI} ^/your-specific-url
RewriteRule .* /succes.php

And put in succes.php:

<?php
header("text/html");
echo "success";
?>

Solution 3:

Tested with Apache 2.4:

<Location /cajuzinho>
    ErrorDocument 200 "mermao"
    RewriteEngine On
    RewriteRule .* - [R=200]
</Location>

See https://httpd.apache.org/docs/2.4/custom-error.html and http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule for more info