Regex: Redirect from non-www to www

Input texts:

http://domain.com
http://www.domain.com
https://domain.com
https://www.domain.com

Regex:

^https?:\/\/(?:www\.)?(.+)

Replace:

https://www.${1}

Result:

https://www.domain.com

References:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *