.htaccess "issues"

software development

#1

Ahhh, I’m having this really annoying problem with RewriteRules in .htaccess.

I have this structure:
/category/path/to/5/

The last part of that is the page number. The thing I’m having trouble with is redirecting requests for page 1 or 0 or 00000 to the url without the last part like: /category/path/to/ instead of /category/path/to/1/ etc. I’ve tried loads of things and have now spent about 2 hours just with this problem and now I’ve run out of ideas and was wondering if anyone else could suggest anything.

Got dreamhost today and so far it has been flawless.
Thanks.