-wuksg
Last Updated: February 25, 2016
·
760
· moiseevigor
2e1e340e378a26f2c69c6dd418060374

Allow optional trailing slash when using optional parameter

I found this way to achive this with Apache mod_rewrite enabled. Snippet of .htaccess

RewriteEngine On

# remove trailing slash
RewriteCond %{HTTPS} off
RewriteRule ^(.+[^/])/$ http://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteRule ^(.+[^/])/$ https://%{HTTP_HOST}/$1 [R=301,L]
Say Thanks
Respond