Solved

Redirect on same server

Posted on 2009-05-05
4
435 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Assisted Solution

by:Ubertam
Ubertam earned 350 total points
ID: 24309810
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
ID: 24309825
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
ID: 24309874
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
ID: 24310421
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

623 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