the index.php of gallery isn’t necessary, I sometimes happen to think and i backuped (is that correct word?) files of modx installation that could have been overwritten. I installed gallery in / because that way i don’t have problems with paths to css and js, and some other things. The gallery run only in embeded mode. This way it works great, but I also need to have short links to clients albums so i need url rewriting.
When gallery creates it’s own rules it doesn’t overwrite the modx .htaccess, but apends it’s own rules above modx’s. Modx has got only 3 lines of rules and gallery has got two of them , so there stays only one to be put somewhere... i didn’t manage to do that anyway..
below is mine g2 .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_URI} !/index\.php$
RewriteRule . - [L]
RewriteCond %{HTTP:Authorization} (.+)
RewriteCond %{QUERY_STRING} !g2_authorization=
RewriteRule . %{REQUEST_URI}?g2_authorization=%1 [QSA]
RewriteCond %{THE_REQUEST} /d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/index\.php$
RewriteRule . /main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3 [QSA,L]
RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/index\.php$
RewriteRule . /index.php?a=112&id=3&opcode=admin&g2_path=%1 [QSA,L]
</IfModule>
And here is mine modx .htaccess:
RewriteEngine On
RewriteBase /
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
So as you can see there is only one line in modx .htaccess that is not in g2 .htaccess
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]