peter pilsl wrote:

I want to configure a virtual host to return 404 for a specific request

I tried mod_rewrite

RewriteRule ^/(forbidden_.*) - [R=404]

RewriteRule ^/forbidden_ - [R=404]

should work, but this depends upon your apache version. It's implemented since 2.1 I think. You're using this in per-server context (outside of <directory>, no .htaccess files), right?

I would need to redirect to a nonexisting url, so the browser would receive a 301 first and then get the 404,

No, there is another way:

RewriteRule ^/forbidden_ /nonexistent [L]

which would produce a 404 not found, too.

--
Robert

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to