this is the weirdest forum ive ever used. Posting here cause I cant post in the right section.

I am not even sure if this is possible. I have a gigantic site where about 20,000 of the pages are handled by 1 processing file. It displays different template pages in the body depending on whether it is on the initial page (site.com/initial/) or sub page (this is the tricky one, explained later) and a product page.

Heres the deal, each product has the potential to be on several sub pages. Currently they are determined by a string in the db.

The identifiers for the initial page and the product page are standard, so a url will always begin with ?main=whatever and it will not always end in a product page, but the product is always &number=

All the sub-category page identifiers do not matter. I currently have them setup as the alphabet. Here are some examples.