My CDN domain is set to
www.mysite.com, and it reads from
mod_dir is enabled on apache, and so any request without a trailing slash is redirected with a
301 to the equivalent URL with a trailing slash.
The issue is that when someone goes to
www.mysite.com/somepage I would expect them to get redirected to
www.mysite.com/somepage/, but apache issues a redirect that includes the domain name too, so the redirect issued from apache is actually
origin.mysite.com/somepage/ and the user now ends up on
origin.mysite.com domain, and whole point of CDN is now lost.
DirectorySlash off but that leads to numerous other problems. The solution I can think of is to have the redirect issue a relative URL, and I am not able to figure out if that is doable at all.