I am trying to set up a self hosted cdn for my site, but I am having problems with the rules in the htaccess file and I can't get it to work.
At the moment the ftp server that will act as CDN has the following filesystem structure:
/
www/
www/htaccess
www/index.html
www/cdn/*
incremental/*
full/*
My .htaccess looks like this right now:
Options All -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
#This snippet basically stops anyone viewing any file on your site that begins with "hta", this will protect it and make it somewhat safer.
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</Files>
<Files /cdn>
Options +Indexes
Satisfy Any
Allow from all
</Files>
I want to allow access to the cdn folder and disallow any other access to the other folders, because in incremental and full there are backups of my main server.
I've been searching for rules for achieve this behaviour but nothing work.
I have to allow Indexes in the cdn folder?
Regards and thank you in advance (And sorry for my english)
deny from all
in it. Your backups should never be web-accessible to begin with, though...