0% found this document useful (0 votes)
36 views15 pages

URL Rewrite Techniques for Developers

This document discusses common URL rewrite rules including adding HTTP protocol, redirecting to www, redirecting subdomains to subfolders, hosting multiple domains, down for maintenance pages, URL rewrite for load balancing, preventing image hotlinking, and HTTP to HTTPS redirects.

Uploaded by

skorlipa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views15 pages

URL Rewrite Techniques for Developers

This document discusses common URL rewrite rules including adding HTTP protocol, redirecting to www, redirecting subdomains to subfolders, hosting multiple domains, down for maintenance pages, URL rewrite for load balancing, preventing image hotlinking, and HTTP to HTTPS redirects.

Uploaded by

skorlipa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like