wpsharks / comet-cache

An advanced WordPress® caching plugin inspired by simplicity.
https://cometcache.com
GNU General Public License v3.0
77 stars 18 forks source link

Sometimes a Double Redirect (Trailing Slash) #915

Open jaswrks opened 6 years ago

jaswrks commented 6 years ago

The Apache Optimizations in Comet Cache are adding this line to the .htaccess file.

RewriteRule ^(.*)$ $1/ [QSA,L,R=301]

Not a problem, but if someone attempts to access a site over http:// and there is also an https:// redirect that needs to take place, this results in two redirects instead of one. Simply because the trailing slash redirect that Comet Cache uses doesn't specifically state what protocol to use, it just keeps the existing protocol. Which again, is fine, because an https:// redirect can occur next. However, if we change this to use the right protocol to begin with, we can shave one additional redirection off for some site owners that enforce https://.

Referencing internal/private ticket. https://secure.helpscout.net/conversation/459070945/2394/