We present a unified scaling theory for the structural behavior of polymers embedded in a disordered energy substrate. An optimal polymer configuration is defined as the polymer configuration that minimizes the sum of interacting energies between the monomers and the substrate. The fractal dimension of the optimal polymer in the limit of strong disorder (SD) was found earlier to be larger than the fractal dimension in weak disorder (WD). We introduce a scaling theory for the crossover between the WD and SD limits. For polymers of various sizes in the same disordered substrate we show that polymers with a small number of monomers N N will behave as in SD, while large polymers with length N N will behave as in WD. This implies that small polymers will be relatively more compact compared to large polymers even in the same substrate. The crossover length N is a function of ν and a, where ν is the percolation correlation length exponent and a is the parameter which controls the broadness of the disorder. Furthermore, our results show that the crossover between the strong and weak disorder limits can be seen even within the same polymer configuration. If one focuses on a segment of size n N within a long polymer (N N) that segment will have a higher fractal dimension compared to a segment of size n N.