Options -MultiViews
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Clean questionnaire URLs.
    RewriteRule ^q/([A-Za-z0-9_-]+)/?$ public/index.php [QSA,L]
    RewriteRule ^s/([A-Za-z0-9_-]+)/?$ public/index.php [QSA,L]

    # The folder root is handled by index.php.
</IfModule>