Solved

Redirect on same server

Posted on 2009-05-05
4
428 Views
Last Modified: 2012-05-06
I want to redirect all requests for one web site to another web site on my server.  I am running IIS 6.0 on Windows Server 2003.  Right now I have just posted a default.asp page in the root directory for the incoming requests that redirects to a "www" page elsewhere on the same server.  Will that work?  Do I have to do anything to the host file?

Example: say a request comes in for www.domain1.com but I want that request to be redirected to www.domain2.com on the same server.  Will what I said above do that if I just put (in the default.asp page in the domain1.com root directory)
[code]
Response.Redirect "www.domain2.com"
[/code]

I can't try it myself because this is the result of a change that I am waiting for dns servers to propagate.
0
Comment
Question by:Bob Schneider
  • 2
4 Comments
 
LVL 5

Assisted Solution

by:Ubertam
Ubertam earned 350 total points
Comment Utility
I've recently done something very similar to this, but it's much easier than that.

Create a new site.  Describe it site1.com or something similar.
Go to the properties of your new site.
Specify the IP address (don't just use "all available" and click Advanced.
Add host header values for however you want to be accessed (this may be more than req'd, but it works):
site1
site1.com
www.site1.com
Click OK.
Go to the Home Directory Tab
Choose "A redirection to a URL"
Type your exact URL in the "redirect to:" box: http://www.site2.com/default.aspx
Choose "The exact URL entered above" and "A permanent redirection for this resource"

Hit apply and make your local DNS changes to point site1, site1.com, and www.site1.com to your IIS server.

Enjoy.
0
 
LVL 5

Accepted Solution

by:
Ubertam earned 350 total points
Comment Utility
By the way, the reason I needed to do this is I have SBS 2003 and wanted to utilize SharePoint Services 3.0.  Our url was going to be http://myserver:3080 (not very end user friendly).  I wanted to name the site Bobber!, accessible at bobber, bobber.com, and www.bobber.com.  I followed the steps above and directed that site to http://myserver:3080/default.aspx and viola!

I also changed the existing site: companyweb to the new URL and it changed over everyone's home page who were using the old SP2.0 site as their home page without them having to do anything.
0
 
LVL 1

Assisted Solution

by:internethotspot
internethotspot earned 150 total points
Comment Utility
Simple way is to use a stealth redirection service such as offered by MyDomain.  When a query or anything is entered, have it contain the entire website address, which would be redirected via DNS server.  For example, going to website www.mywhataniceday.com could stealth redirect to www.myyouareugly.com without anyone knowing.  The address would still show the requested address (stealth).  However the user would actually be on the second site.
0
 

Author Comment

by:Bob Schneider
Comment Utility
Thanks so much for the help but the first solution doesn't work because I need to pass a query string and it won't take that.  RE: the stealth approach, I don't care if anyone knows about the site that it is redirected to or not but I do need to pass the query string.  So I guess my initial example should have been
"www.domain2.com/folder/a_page.asp?some_var=1

More help?
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now