well I wanted absolutely nice SEO friendly URLs, so here comes the half-baked solution
ATTENTION: apache epxerts only
I creat 3 top roots: album, image, show
The first 2 point to index.php and show points to ... image.php
The breadcrumbs do not yet work, but lytebox works.
enable mod_substitute in apache
then add this in the config (could also add it into .htaccess, but I added it in the main site config)
Code:
AllowEncodedSlashes On
# anti rewrite the urls to path
# using mod_substitute
<LocationMatch /(album|image)>
AddOutputFilterByType SUBSTITUTE text/html
# href="http://example.com/image.php?twg_album=abc&twg_show=A.jpg">
# href="/show/abc/A.jpg"
Substitute s,href=(['"])(http://[^/]*)?/[^>]*image.php\?twg_album=([^&]*)&twg_show=([^"]*['"]),href=$1$2/show/$3/$4,
#<a href="http://example.com/alXbum/aXbc?twg_album=abc&twg_show=A.jpg">
#<a href="http://example.com/image/abc/A.jpg">
Substitute s,href="([^:]*)://([^/]*)/.*\?twg_album=([^&]*)&twg_show=([^"]*)",href="$1://$2/image/$3/$4",
#<a href="/alXbum/aXbc?twg_album=abc&twg_show=A.jpg">
#<a href="/image/abc/A.jpg">
Substitute s,href=(["'])/[^>]*\?twg_album=([^&]*)&twg_show=([^"]*["']),href=$1/image/$2/$3,
# root all relative URLs to top site URL (that's not compatible with TWG in subdir but works for me)
Substitute s,src=(["'])([^/]),src=$1/$2,
# don't do it for http: at the beginning. yes, ugly... who cares?
Substitute s,href=(["'])([^/h][^t][^t][^p][^:]),href=$1/$2,
# for /dtree/dtree-min.js but still not perfect
Substitute s,\+'buttons,\+'/buttons,
</LocationMatch>
#RewriteCond %{QUERY_STRING} ^twg_album=(.*)&twg_show=(.*)$
#RewriteRule .* /image/%1/%2? [R,L]
#RewriteCond %{QUERY_STRING} ^twg_album=(.*)$
#RewriteRule .* /album/%1? [R,L]
# Do not do anything for already existing files and folders
RewriteCond /home/george/Limbermen/%{REQUEST_FILENAME} -f [OR]
RewriteCond /home/george/Limbermen/%{REQUEST_FILENAME} -d
RewriteRule (.*) - [L]
RewriteRule ^/album/(.*)$ /index.php?twg_album=$1 [L]
RewriteRule ^/image/(.*)/(.*)$ /index.php?twg_album=$1&twg_show=$2 [L]
RewriteRule ^/show/(.*)/(.*)$ /image.php?twg_album=$1&twg_show=$2 [L]