Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (40 sloc) 1.59 KB
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /
# remove trailing slashes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} !^\.localhost$ [NC]
RewriteRule ^(.+[^/])/$ http://%{HTTP_HOST}/$1 [R=301,L]
RewriteRule !^public/ public%{REQUEST_URI}
RewriteRule /json-rpc/json-rpc.js libs/json-rpc/json-rpc.js
# Subdomain to lang redirect
RewriteCond %{HTTP_HOST} ^(.*)\.openclipart.org
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} !^staging.
RewriteRule (.*) /$1?lang=%1 [QSA]
#<FilesMatch "openclipart.xml$">
# Header set Content-Type application/opensearchdescription+xml
#</FilesMatch>
# TODO: gzip compression (on gadni handled in apache conf for virtual host)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} people/.* [OR]
RewriteRule ^ index.php [QSA,L]
#RewriteRule people/.* - [F]
# Prevent to access database credentials
RewriteCond %{REQUEST_FILENAME} config.json
# accessed only from command line
RewriteCond %{REQUEST_FILENAME} recreate_tags.php [OR]
RewriteRule .* - [F]
# Display maintenance page if we're doing some work on the site
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{REQUEST_URI} !^/style.css
RewriteCond %{REQUEST_URI} !^/images(.*)
#RewriteCond %{REQUEST_URI} !^/people(.*)
RewriteRule ^.*$ public/maintenance.html
<ifModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</ifModule>