in reply to Re: SSI or .HTACCESS for CGI
in thread SSI or .HTACCESS for CGI

You can be a little more selective in your matching, and include logic to append a trailing slash if there isn't one already.

if ( $ENV{'REQUEST_URI'} =~ m|\A/shop(/.*)$| ) { my $url = $1; $url .= '/' if $url !~ m|/$|; $sth = $dbh->prepapre("..."); # ... }

However, if you're working with real directories, you shouldn't encounter the trailing slash problem as Apache automatically redirects such requests to the proper location IIRC.

BTW, is there anything else in /shop/? If not, rather than using physical directories, why not rename your script to 'shop'?

You wouldn't need to create any subdirectories then as they'd all be virtual extensions of your CGI, with the requested directory appearing in $ENV{'PATH_INFO'} alread minus the /shop/ portion but definitely in need of some trailing slash massaging.

    --k.