I have a redirect in one of my templates like so:
{redirect="path/to/template/{url_title}/"}
It works for the most part, except for one problem: EE is stripping the trailing slash. I have Apache configured to enforce trailing slashes for SEO/Analytics purposes, so when people hit this template they’re getting a double redirect (once from EE to the new URL path, then a second time from Apache enforcing the trailing slash).
Is there no way to get ExpressionEngine to stop stripping the slash from my redirect path? I can always redo the redirect in PHP, but I’d prefer not to.
There isn’t a way to prevent trailing slashes from being stripped from the redirect
variable.
We strip it, because a trailing slash indicates a “directory” and ExpressionEngine doesn’t use directories for it’s URLs. Keep in mind that in general / vs no-/ isn’t a big deal, so long as you are consistent on your site, and don’t allow a URL to be served in both ways.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.