httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Oliver.Scha...@unilog.de>
Subject [users@httpd] RE [users@httpd] force 404 error
Date Thu, 16 Feb 2006 08:11:35 GMT
Update

RewriteCond %{REQUEST_URI} ^(.*)/\.svn(.*)$
RewriteRule ^(.*)$ /errors/404.html [R,L]

I tested this and it finds
/dir1/.svn
/.svn
but it leaves untouched
/tsvn

bye

Oliver

-----Urspr√ľngliche Nachricht-----
Von: Oliver.Schaudt@unilog.de [mailto:Oliver.Schaudt@unilog.de]
Gesendet: Mi 15.02.2006 21:44
An: users@httpd.apache.org
Betreff: RE: [users@httpd] force 404 error
 
You can put RewriteCond/RewriteRule inside 
server config, virtual host, directory, .htaccess
see 
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritecond


You don't need the DirectoryMatch because the same thing makes RewriteCond for you.

REQUEST_URI is the part after host:port
e.g "www.example.com:8000/dir1/dir2/.svn" the "/dir1/dir2/.svn"-part 

  RewriteCond %{REQUEST_URI} ^(.*)/.svn(.*)$
  RewriteRule ^(.*)$ /errors/404.html

This should do the trick to rewrite all ".svn" which could be in any URI.

bye
Oli

-----Urspr√ľngliche Nachricht-----
Von: Uk1ah Sm1th [mailto:ukiah@faction42.com]
Gesendet: Mi 15.02.2006 18:04
An: users@httpd.apache.org
Betreff: Re: [users@httpd] force 404 error
 
On Wed, Feb 15, 2006 at 05:38:05PM +0100, Oliver.Schaudt@unilog.de wrote:
> >Right now they return 403 forbiden
> In your first post you talked of a HTTP_FORBIDDEN (403) not from a HTTP_OK (200)

Sorry about the confusion. I currently have the .svn directorys set as
forbidden.

> 
> With
>   ErrorDocument 403 404.html
> you send each user which gets a HTTP_FORBIDDEN (403) your HTTP_NOT_FOUND page
> 
> > I am looking for a way to change a http response from 200 to 404
> This is new and cannot be covered alone by the thing above
> 
> Here should help a RewriteRule and a RewriteCond in a manner like this
>   
>   RewriteRule ^(.*)$ 404.html
> 
> Oli

I thinks this is what I'm looking for. Could it be put inside a
DirectoryMatch item?

<DirectoryMatch "^/.*/\.svn/">
   RewriteCond .*
   RewriteRule ^(.*)$ /errors/404.html
</DirectoryMatch>

thanks again.

> 
> -----Urspr?ngliche Nachricht-----
> Von: Uk1ah Sm1th [mailto:ukiah@faction42.com]
> Gesendet: Mi 15.02.2006 17:20
> An: users@httpd.apache.org
> Betreff: Re: [users@httpd] force 404 error
>  
> On Wed, Feb 15, 2006 at 04:54:51PM +0100, Oliver.Schaudt@unilog.de wrote:
> >  ErrorDocument 403 /path/to/errorfile/404.html 
> > see
> >  http://httpd.apache.org/docs/2.0/custom-error.html
> > 
> > bye
> 
> I am not looking for how to make custom error pages. I am looking for a
> way to change a http response from 200 to 404. I have some directorys
> that exist on my server, .svn directorys. When a user types in
> http://example.com/.svn the NORMALLY get a 200 response and the file.
> This is because the .svn directory is there and readable. I want a
> user to recieve a 404 file not found INSTEAD of the 200, without me
> having to manually delete the .svn directorys.
> 
> I don't want users to even know that the .svn directorys exist.
> 
> Thanks .U
> 
> -- 
> "Well done is better than well said."
>              - Benjamin Franklin (1706-1790)
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 


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

-- 
"Well done is better than well said."
             - Benjamin Franklin (1706-1790)

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




Mime
View raw message