Epoxides are very special ethers because their three-membered ring is highly tensioned thus making them very reactive.
The aperture of an epoxide displays a different 'regiochemistry' depending on the reaction medium ...
However, the attacked carbon ALWAYS INVERTS its configuration.
Mechanism for the direct aperture
(SN2-like):
In basic medium, the nucleophile - methoxide in this case - directly attacks the least hindered position.
The mechanism is very close to SN2 - SN2-like -and therefore is very sensitive to steric hindrance in the pentacoordinated TS.
Mechanism for the acid-catalyzed aperture
(SN1-like):
Epoxides have a slight basic character.
In strong acid, a portion of epoxide molecules are protonated.
As a consequence, the protonated molecules see their electrophilicity increased and the C-O bonds weaken.
If the epoxide is non-symmetric, the C-O rupture leading to the most substituted carbocation-like structure is the most favored one.
The latter mechanism resemples the SN1 - SN1-like.
Yet, please notice a big difference!!!
The nucleophile attack happens almost sumultaneously to the C-O bond breakage.
IMPORTANT: In this reaction the carbocation never completely forms.
Therefore, despite the fact that the acidic aperture of epoxides is regarded as a SN1-like mechanism, the inversion - NOT racemization - of the attacked carbon takes place.