Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)/(.*)/(.*)/(.*)/$ /browse/index.php?y=$1&s=$2&c=$3&p=$4
If somebody leaves the last backslash off, like:
/browse/1/2/3/4
the user is sent to my 404 page
The page only resolves when the backslash is included like:
/browse/1/2/3/4/
What can I do here?
RewriteRule (.*)/(.*)/(.*)/(.*)[b]/?$[/b] /browse/index.php?y=$1&s=$2&c=$3&p=$4
Jim
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$ /browse/index.php?y=$1&s=$2&c=$3&p=$4
Jim
In almost all cases, mod_rewrite code will work better and *much* more efficiently if a more-specific pattern is used. There are situations that require the use of ".*" but it is best if used sparingly and only when necessary.
Jim