Re: [users@httpd] return 404 for specific url ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux