Tom Gullen
Tom Gullen

Reputation: 61755

ASP.net URL rewrite between 2 sites

I have 2 websites on the same web server. One server is called static.net and the other is live.com.

I have a page on static.net that I wish to be URL-rewritten to a page on live.com. Is it possible to do this?

It's a design problem I can solve by moving a lot of files and folders around but I would really like to avoid this if possible. If it's not possible, does anyone have any ideas that can help me get around this?

Upvotes: 0

Views: 168

Answers (1)

Jeremy McGee
Jeremy McGee

Reputation: 25210

URL rewriting can only change what's shown to the right of the hostname and "/" in a URL: so it won't be possible to rewrite an URL to a different host.

You can, in your program code, use HttpContext.Current.Redirect() to perform a full redirect of the client browser to the other URL. This performs a full postback -- it sends an HTTP 301 or 302 to the other site, effectively telling your users that your page has been moved.

Upvotes: 1

Related Questions