Community Patterns

Community Library Entry

1

Regular Expression
Created·2023-10-12 07:48
Updated·2023-10-12 09:42
Flavor·PCRE2 (PHP)

/
(http[s]?):(\/+)
/
gm
Open regex in editor

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