I added a feature to my site map utility that does that. My routine is much more complex than what others have posted so far, and handles directory detection in some cases by comparing webpages retrieved through URLs with and without a trailing slash. A slashed target would break some links that end with a file, and some URL's point to an extensionless file that looks like a directory. My code is proprietary, but the instructions in the configuration utility currently read:
Slash Directory
Type yes to append a slash to each link target that points to a directory, when a trailing slash isn't already present (speeds loading of target page). Extensionless files will be detected and not slashed. Otherwise, type no or leave blank.Slash Base
Type yes to append a slash to each link target that points to a base directory (domain name), when a trailing slash isn't already present. Otherwise, type no or leave blank. Targets that specify a home page's file, such as domain.com/index.html, will not be slashed. This feature adds consistency to link targets, but does not speed loading of target page.
In reply to Re: Regex - one and only one / at beginning and end of file path
by Wassercrats
in thread Regex - one and only one / at beginning and end of file path
by mikedshelton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |