# IPTCgallery 2 on Apache. Without this file (or on nginx) everything still works,
# with links like ?g=gallery&p=photo instead of /gallery/photo.

<IfModule mod_rewrite.c>
  <IfModule mod_env.c>
    SetEnv GALLERY_PRETTY_URLS 1
  </IfModule>
  RewriteEngine On
  # Nothing in the photo folders or the cache ever runs as code
  RewriteRule ^(galleries|cache)/.*\.(php\d?|phtml|phar|cgi|pl|py|sh)$ - [F,NC]
  # config.ini is settings, not a page
  RewriteRule ^config\.ini$ - [F,NC]
  # Everything that isn't a real file (folders too, so no listings) goes to index.php
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^ index.php [L]
</IfModule>
