You are not logged in.

#1 2007-12-09 05:50:17

Pigletto
Member
From: Poland
Registered: 2007-05-06
Posts: 82
Website

How to protect .svn folders with htaccess?

Hi

Question is simple:
how to protect .svn folders (also in subfolders) with .htaccess file?

So far I have .svn/ folder inaccessible but .svn/README.txt may be read via web.

Example is here:

http://wkurzonamadzia.pl/.svn/README.txt

Corresponding .htaccess is currently:

Options -indexes
<IfModule mod_expires.c>
  <FilesMatch "\.(gif|jpe?g|png|js|css)$">
      ExpiresActive on
      ExpiresDefault "access plus 1 day"
  </FilesMatch>
</IfModule>

<FilesMatch "\.svn/.*">
   order deny,allow
   deny from all
</FilesMatch>

<Files .htaccess>
order deny,allow
deny from all
</Files>

--
Pigletto

Offline

 

#2 2007-12-09 17:27:59

IAIHMB
Member
From: Hudson, Florida.
Registered: 2006-09-19
Posts: 1362

Re: How to protect .svn folders with htaccess?

I believe that the following mod_rewrite will give you the desired affect:

RewriteEngine on
RewriteRule .*\.svn/.* - [F]

Hope it helps. smile


-David Sissitka

Offline

 

#3 2007-12-10 00:54:23

Pigletto
Member
From: Poland
Registered: 2007-05-06
Posts: 82
Website

Re: How to protect .svn folders with htaccess?

Thanks. This works fine smile

Offline

 

#4 2008-01-25 18:07:28

orestis
Member
Registered: 2008-01-25
Posts: 14

Re: How to protect .svn folders with htaccess?

Hi, I'm new around here!

I serve some static files (CSS, JS etc) of my application, using a symbolic link. These are under SVN so I can see the .SVN subdirectories. I'm not sure where I should put the .htaccess file, I can't find anything already made...

Offline

 

#5 2008-01-26 14:04:34

remi
Member
From: London
Registered: 2006-09-19
Posts: 741
Website

Re: How to protect .svn folders with htaccess?

orestis wrote:

Hi, I'm new around here!

I serve some static files (CSS, JS etc) of my application, using a symbolic link. These are under SVN so I can see the .SVN subdirectories. I'm not sure where I should put the .htaccess file, I can't find anything already made...

Put the .htaccess file at the root of the directory that is being served (ie: the destination folder of your symlink).

Cheers,

Remi.


WebFaction - Smarter web hosting

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson