Forum Moderators: phranque
Because of this, I'm then defining categories and other pages like this: imag.es/cat:flowers
Because the project is fairly small, all links are directed through gallery.php?id=[query], where the query passed is parsed and turned into the category/image/page that it's intended to go to. This works fine.
However I haven't managed to find a regular expression for .htaccess that will successfully work with a colon. URLs without a colon work correctly, but as soon as a colon is introduced it ends up returning a 403 Forbidden error.
My current code is this:
RewriteRule ^([-_A-Za-z0-9]+)/?$ gallery.php?id=$1 [NE,NC] Thanks in advance.
I presume you've tried including an escaped colon in your alternate-character group in the regex above, so you may end up having to examine "THE_REQUEST" using a RewriteCond, testing for your existing regex group OR \%3[Aa] in order to match and back-reference URL-encoded colons; The URL-path seen by RewriteRule itself will have already been decoded.
Jim
If you use any "reserved" or "unwise" characters, it may in fact work fine for you right now, but then you may hit a brick wall such as this Google Analytics "semicolon problem" at some time in the future.
"If it's expeditious, there's probably a catch" is a good phrase to keep in mind.
Jim