I have a directory structure as follows:
/gallery
----index.php
----/23XASDTAGH
----/24XGA43KJA/
I'd like to use mod rewrite to rewrite if a directory exists. so:
www.example.com/gallery/23XASDTAGH/
becomes
www.example.com/gallery/index.php?gallery=23XASDTAGH
but i'd like to do this silently, so no changes happen to the url. now i have this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME}/ -d
RewriteRule (.*) /gallery/index.php?gallery=$1 [L]
which works with
www.example.com/gallery/23XASDTAGH/
but the odd thing is when i leave the trailing slash off the end it changes the url to
www.example.com/gallery/23XASDTAGH/?gallery=23XASDTAGH
how can i get it to work with or without the trailing slash?