I had the following url validation regex:
/(ftp|https?)://[^ \"]+$/
This is from the ref: Regular expression for URL validation (in JavaScript)
This
Try this
function is_valid_url(url) { return url.match(/^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/); }
Call the is_valid_url(YOUR_WEBSITE_URL) function everywhere which you want to website validate.
is_valid_url(YOUR_WEBSITE_URL)