Solved

Redirect on same server

Posted on 2009-05-05
4
431 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

775 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