Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(http[s]?):(\/+)
/
gm

Description

Make sure http[s]:// uses two slashes, not one.

IIS rewrite rules removes double slashes in the raw URL, breaking YOURLS (PHP) for example. This regexp changes all single slashes to double after a web protocol, including nested querystrings.

Submitted by DeveloperDog - a year ago (Last modified a year ago)