URL Rewrite for Developers
Common URL Rewrite Rules
Scott Forsyth
weblogs.asp.net/owscott
@scottforsyth
[email protected]
In this Module
Adding HTTP_PROTOCOL
Add www to corresponding domain
Redirecting a subdomain to subfolder
Hosting multiple domains under one site
Down for maintenance page
URL Rewrite for ARR load balancing
Prevent image hot-linking
HTTP to HTTPS redirects
Adding HTTP_PROTOCOL
Add www to corresponding domain
Redirecting a subdomain to subfolder
Hosting multiple domains under one site
Down for maintenance page
URL Rewrite for ARR load balancing
Prevent image hot-linking
HTTP to HTTPS redirects
Adding HTTP_PROTOCOL
Add www to corresponding domain
Redirecting a subdomain to subfolder
Hosting multiple domains under one site
Down for maintenance page
URL Rewrite for ARR load balancing
Prevent image hot-linking
HTTP to HTTPS redirects
Adding HTTP_PROTOCOL
Add www to corresponding domain
Redirecting a subdomain to subfolder
Hosting multiple domains under one site
Down for maintenance page
URL Rewrite for ARR load balancing
Prevent image hot-linking
HTTP to HTTPS redirects
Adding HTTP_PROTOCOL
Add www to corresponding domain
Redirecting a subdomain to subfolder
Hosting multiple domains under one site
Down for maintenance page
URL Rewrite for ARR load balancing
Prevent image hot-linking
HTTP to HTTPS redirects
Adding HTTP_PROTOCOL
Add www to corresponding domain
Redirecting a subdomain to subfolder
Hosting multiple domains under one site
Down for maintenance page
URL Rewrite for ARR load balancing
Prevent image hot-linking
HTTP to HTTPS redirects
Down For Maintenance
Custom Response
Redirect to maintenance page at site level
Redirect to maintenance page to server level
Down For Maintenance
Custom Response
Quick and easy
Need to set custom errors to off
Ugly page
Redirect to maintenance page at site level
Need to protect web.config, maintenance page, dependencies
Add:
<%
Response.StatusCode = 503
Response.TrySkipIisCustomErrors = True
%>
Redirect to maintenance page at server level
Need to ensure that you don’t have a breaking change in web.config
Same page as at site level
Adding HTTP_PROTOCOL
Add www to corresponding domain
Redirecting a subdomain to subfolder
Hosting multiple domains under one site
Down for maintenance page
URL Rewrite for ARR load balancing
Prevent image hot-linking
HTTP to HTTPS redirects
Adding HTTP_PROTOCOL
Add www to corresponding domain
Redirecting a subdomain to subfolder
Hosting multiple domains under one site
Down for maintenance page
URL Rewrite for ARR load balancing
Prevent image hot-linking
HTTP to HTTPS redirects
Adding HTTP_PROTOCOL
Add www to corresponding domain
Redirecting a subdomain to subfolder
Hosting multiple domains under one site
Down for maintenance page
URL Rewrite for ARR load balancing
Prevent image hot-linking
HTTP to HTTPS redirects
Visiting non-www for a www certificate
URL= https://domain.com Certificate=www.domain.com
URL=https://www.domain.com Certificate=www.domain.com
SSL Path
URL
Incoming Site SSL Packet Site is
Rewrite
request binding Decrypted processed
runs
Where Are We?
Adding HTTP_PROTOCOL
Add www to corresponding domain
Redirecting a subdomain to subfolder
Hosting multiple domains under one site
Down for maintenance page
URL Rewrite for ARR load balancing
Prevent image hot-linking
HTTP to HTTPS redirects