RewriteEngine On

RewriteCond %{HTTP_HOST} ^archiv\.freeteknomusic\..+$
RewriteRule ^(.*)$ http://archive.freeteknomusic.org/$1     [L,R=301,QSA]


##RewriteRule ^.*$ info.html [L,QSA]


##RewriteCond %{REQUEST_FILENAME} !-d
##RewriteCond %{REQUEST_FILENAME} !-f
##RewriteRule ^d2d\/sety\.cz\/xml\.(timestamp|xml|gz)\/?$ /.d2d/.xml.$1 [L,QSA]

##RewriteCond %{REQUEST_FILENAME} !-d
##RewriteCond %{REQUEST_FILENAME} !-f
##RewriteRule ^d2d\/sety\.cz\/text\.(timestamp|html)\/?$ /.d2d/.text.$1 [L,QSA]


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+\/)playlist(\.m3u|\.sort|\.rsort|\.asort|\.rand|\.pls|\.xml|\.xspf)?$ /playlist.php?dir=$1&opt=$2 [L,QSA]


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^p\.xspf\/?(.*)$        /p.php?dir=$1 [L,QSA]


##RewriteCond %{REQUEST_FILENAME} !-d
##RewriteCond %{REQUEST_FILENAME} !-f
##RewriteRule ^articles?\/?(.*)$  /.a/$1 [L,QSA]


RewriteCond %{REQUEST_FILENAME}     !-d
RewriteCond %{REQUEST_FILENAME}     !-f
RewriteCond %{ENV:REDIRECT_STATUS}  !=503
RewriteCond %{REQUEST_URI}          \.(mp3|ogg|wma|avi|mpe?g|wmv)$
RewriteRule (.+)                    http://freeteknomusic.org/mp3/$1 [R=307,L]



#indexoptions +IgnoreCase +SuppressDescription NameWidth=* +SuppressHTMLPreamble

#indexoptions +SuppressHTMLPreamble
#options +indexes
indexignore playlist.m3u robots.txt
indexignore robots.txt playlist.m3u playlist.php NEWS.html HEADER.html README.html p.js p.php p.swf playlist.func.php
indexignore .a .d2d .forum .ibrowse .id3 .playlists
indexignore NOLINK.php 404.php 503.html update_chown.sh show_last_error_uniq.sh


#
# deny for an ip (for a while)
#
ErrorDocument 503 /503.html

#RewriteCond %{REMOTE_ADDR} ^84\.242\.106\.113$
#RewriteCond %{ENV:REDIRECT_STATUS} !=503
#RewriteCond %{REQUEST_URI} \.(mp3|ogg|wma|avi|mpe?g|wmv)$
#RewriteRule .* - [R=503,L]
exignore NOLINK.php 404.php 503.html update_chown.sh show_last_error_uniq.sh


#
# deny for an ip (for a while)
#
ErrorDocument 503 /503.html

#RewriteCond %{REMOTE_ADDR} ^84\.242\.106\.113$
#RewriteCond %{ENV:REDIRECT_STATUS} !=503
#RewriteCond %{REQUEST_URI} \.(mp3|ogg|wma|avi|mpe?g|wmv)$
#RewriteRule .* - [R=503,L]
