Why are my CP links navigating to the .../optimized/.../themes/ directory instead of where I point them?
Customer Portal (CP)
Sometimes links in CP will resolve to something like this:
When they should send the user to a page like this:
The .../optimized/.../themes/... path is being used because the link is using a relative path rather than an absolute one. Looking at your page source code, a link that looks like this will break in this way:
Changing relative links to absolute links in your page's source code will fix the problem. For the example above, this would be the corrected href link in the source code:
In CP, this tag shows up inside the <head> tags on the page:
This sets the base URL that all relative links are, well, relative to, so any link will follow the base href value. This is how all the CSS and other assets like that on the page get loaded from the correct environment when you view a page in development/staging/production.