Take a look at your current .htaccess configuration. If you can have the following lines:
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
They contain most of the rewriting of the URL, which matters. The first three conditions say that all URLs will be rewritten with the exception of existing files, directories and a request for /favicon.ico Here you can add your favorite conditions. For example, to avoid rewriting for URLs of the form /gallery/.*:
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteCond %{REQUEST_URI} !^/gallery/.*$ RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
source share