# .htaccess file for installation of MediaCore with Apache/FastCGI
# See installation instructions at http://getmediacore.com/docs/install/apache-fastcgi.html

Options +ExecCGI +FollowSymlinks
AddHandler fastcgi-script .fcgi
RewriteEngine On

# Create rewrite rules for media and podcast images
RewriteRule ^images/media/(.*)$ mediacore.fcgi/images/media/$1 [L]
RewriteRule ^images/podcasts/(.*)$ mediacore.fcgi/images/podcasts/$1 [L]

# Create rewrite rules for serving MediaCore's static content
RewriteRule ^(admin/)?(styles|images|scripts)/(.*)$ public/$1$2/$3 [L]

# Create rewrite rules for pointing mediacore requests to fastcgi script
RewriteRule ^mediacore\.fcgi(/.*)$  - [L]
# If the file requested doesn't exist on the filesystem, redirect to mediacore.fcgi
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mediacore.fcgi/$1 [L]

