I want to add the trailing slashes at the end of the domain name.
For example, redirect from https://www.eatonline.dk to https://www.eatonline.dk/
I want to add the trailing slashes at the end of the domain name.
For example, redirect from https://www.eatonline.dk to https://www.eatonline.dk/
You can keep you dynamically changing URL in an variable and can add the slash at the end
For example : var URL = "www.eatonline.dk" (You can assign the value as dynamically here ). url = url + "/"; Now the URL variable will have the value as "www.eatonline.dk/" which is still an link.
Try this to add trailing slash to all urls
RewriteEngine On
RewriteCond %{HTTPS} !off
RewriteRule (.*) https://%{HTTP_HOST}/$1$2/ [L,R=301]
it will redirect:
https:// www.eatonline.dk > https:// www.eatonline.dk/
and also
https:// www.eatonline.dk/test > https:// www.eatonline.dk/test/