Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  RewriteBase /
  RewriteRule ^product/attachment/([^/]+)/([^/]+)/(.+)$ index.php?module=stProduct&action=downloadAttachment&folder=$1&culture=$2&filename=$3 [L]
  RewriteRule ^product/image/([0-9]+)/(.+)$ index.php?module=stProduct&action=showImage&folder=$1&image=$2 [L]

  # we skip all files with .something
  # comment the following 3 lines to allow periods in routes
  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.html$
  RewriteCond %{QUERY_STRING} ^pc_module_type=+$
  RewriteRule .* - [L]

  # 404 for non existed images
  RewriteCond %{REQUEST_URI} \.(gif|jpeg|jpg|png|GIF|JPEG|JPG|PNG)$
  RewriteCond %{REQUEST_URI} !^(/media/products)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule .* 404_image.php [L]
  
  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

# big crash from our front web controller
ErrorDocument 500 "<h2>Application error</h2>symfony application failed to start properly"

<IfModule mod_headers.c>
  <Files ~ "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
    Header set Expires "Thu, 15 Apr 2020 20:00:00 GMT"
  </Files>
</IfModule>

<IfDefine sote>
 <FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
   AddHandler x-httpd-fastphp5 .inc .php .php3 .php4 .php5 .phtml
 </FilesMatch>
</IfDefine>