How should I add o a trailing slash at the end of a URL in apache traffic server? I checked that in normal Apache using rewrite and regex with the following configuration, if the user does not add a slash at the end of the url, it can be entered in different directories without error. But in server traffic, unfortunately, the syntax has changed and I found the following configuration, but it didn't work. Is this a bug or can it be done by modifying config?
example task: example.co/text/fast redirect to example.co/test/fast/ EXAMPLE – REDIRECT ALL URLS THAT DOESN’T HAVE A TRAILING SLASH TO URLS WITH A TRAILING SLASH in apache
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ domain.com/$1/ [L,R=301]
EXAMPLE – REDIRECT ALL URLS THAT DOESN’T HAVE A TRAILING SLASH TO URLS WITH A TRAILING SLASH in Traffic server (this regex can recognize slash)-(it didnt work)
cond %{CLIENT-URL:PATH} /^([^.]*[^/])$/ set-redirect 301 http://different_origin.example.com/%{CLIENT-URL:PATH}/