Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 439
  • Last Modified:

Redirect on same server

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
Bob Schneider
Asked:
Bob Schneider
  • 2
3 Solutions
 
UbertamCommented:
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
 
UbertamCommented:
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
 
internethotspotCommented:
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
 
Bob SchneiderAuthor Commented:
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now