You are here: Home → Table of contents → Common Patterns → Redirecting pages
4.20. Redirecting pages
You can use Greasemonkey to automatically redirect certain pages, by setting the window.location.href
property.
Example: Redirect a site to its secure counterpart
window.location.href = window.location.href.replace(/^http:/, 'https:');