DNS ( Subdomain Problem) in ASP.NET

For the subdomain i have used re-write rules

I have redirect [*].xyz.com to xyz.com/birthday.aspx?id=[*]

For eg.
Consider user name is john
I have redirect "http://john.xyz.com" to "http://xyz.com/birthday.aspx?id=john"

It is redirecting properly and displays the page content,but due to redirection images and css is not working properly.
Copy and paste the following two urls on browser you will see the difference

1. Subdomin : http://john.xyz.com

2. Actual      : http://xyz.com/birthday.aspx?id=john
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Refael AckermannCommented:
You need to figure our how your going to serve linked resources (images, css, js files, and other pages). Then you'll need to make sure the links in the rendered ASPX point to the right destination. For this purpose using '~/zyx.css" will not be good.

You should know that from the browser's perspective the following two URL are totally different, and for security concerns are even considered to be on different (untrusted) sites.
  1. http://xyz.com/1.css
  2. http://john.xyz.com/1.css

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.