RewriteEngine On
RewriteRule ^code(|/)$ code.php
RewriteRule ^login/$ loginprocess.php
RewriteRule ^logout/$ logoutprocess.php
RewriteRule ^register/$ registration.php
RewriteRule ^cloud-save/$ saveimage.php
RewriteRule ^cloud-delete/$ deleteimage.php
RewriteCond %{QUERY_STRING} ^user_id=(d+)$
RewriteRule ^cloud-images/$ getimages.php?user_id=%1
##################
Options -MultiViews
Options -Indexes
# Force the latest IE version, in various cases when it may fall back to IE7 mode
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
</IfModule>
</IfModule>
<IfModule mod_headers.c>
# Because X-UA-Compatible isn't sent to non-IE (to save header bytes),
# We need to inform proxies that content changes based on UA
Header append Vary User-Agent
# Cache control is set only if mod_headers is enabled, so that's unncessary to declare
</IfModule>
# video
AddType video/ogg ogg
AddType video/ogg ogv
AddType video/mp4 mp4
AddType video/webm webm
# Proper svg serving. Required for svg webfonts on iPad
# twitter.com/FontSquirrel/status/14855840545
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
# webfonts
AddType application/vnd.ms-fontobject eot
AddType font/truetype ttf
AddType font/opentype otf
AddType font/woff woff
# assorted types
AddType image/vnd.microsoft.icon ico
AddType image/webp webp
AddType text/cache-manifest manifest
AddType text/x-component htc
AddType application/x-chrome-extension crx
# gzip compression.
<IfModule mod_deflate.c>
# html, txt, css, js, json, xml, htc:
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
# webfonts and svg:
<FilesMatch ".(ttf|otf|eot|svg)$" >
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
# disable gzip compression for video files
SetEnvIfNoCase Request_URI .(og[gv]|mp4|m4v|webm)$ no-gzip dont-vary
# these are pretty far-future expires headers
# they assume you control versioning with cachebusting query params like
# <script src="application.js?20100608">
# additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# if you don't use filenames to version, lower the css and js to something like
# "access plus 1 week" or so
<IfModule mod_headers.c>
# cache.manifest needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
<FilesMatch ".(manifest)$">
Header set Expires "access plus 0 seconds"
</FilesMatch>
# media: images, video, audio
<FilesMatch ".(jpg|jpeg|png|gif|swf|ogg|ogv|mp4|mp3|webm)$">
Header set Expires "access plus 1 month"
</FilesMatch>
# webfonts
<FilesMatch ".(ttf|otf|woff|svg|svgz|eot)$">
Header set Expires "access plus 1 month"
</FilesMatch>
# css and javascript
<FilesMatch ".(css|js)$">
Header set Expires "access plus 1 month"
</FilesMatch>
Header append Cache-Control "public"
</IfModule>
# Since we're sending far-future expires, we don't need ETags for
# static content.
# developer.yahoo.com/performance/rules.html#etags
FileETag None
# you probably want www.example.com to forward to example.com -- shorter URLs are sexier.
# no-www.org/faq.php?q=class_b
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>
# use utf-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8
# force utf-8 for a number of file formats
AddCharset utf-8 .html .css .js .xml .json .rss
# We don't need to tell everyone we're apache.
ServerSignature Off