Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 9th, 2004, 03:13 PM
Registered User
 
Join Date: Mar 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Domain forwarding with web.config?

Is it possible to forward an entire site from the web.config file? May I please have details? Thank you!

 
Old March 9th, 2004, 04:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I'm not sure but it is easier to use this:

<meta http-equiv="refresh" content="1;URL=http://www.google.com">

 
Old March 9th, 2004, 04:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

See if this helps:

http://www.codeproject.com/aspnet/domainforward.asp

J
 
Old March 9th, 2004, 06:39 PM
Registered User
 
Join Date: Mar 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've already seen this. Thank you. I am beginner at asp.net and can't make heads or tails of it. Is there an easier way. The Meta "refresh" only redirects on one page. I need the user to be redirected to another domain when he hits any page. I can't edit IIS directly and I don't want to pay money for my hosting services to do it for me. Will web.config be my answer? please help!


Quote:
quote:Originally posted by katsarosj
 See if this helps:

http://www.codeproject.com/aspnet/domainforward.asp

J
 
Old March 10th, 2004, 12:26 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You want EVERY page to cause the user to redirect to another URL?

You could remove every page from the site, modify the web.config to specify the 404 error page. This single page would redirect to the new URL. Simply by deleting all pages but the 404 handler page, you'll make EVERY "page" redirect.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old March 15th, 2004, 01:55 PM
Registered User
 
Join Date: Mar 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

planoie, this works, but it only works if you try to call an .aspx file. Is there a way to make this work on html files. Keep in mind I don't have access to the IIS management console. Thanks!

Here's the web.config syntax:
        <customErrors defaultRedirect="http://www.destination.com" mode="RemoteOnly">
        <error statusCode="404" redirect="http://www.destination.com"/>
        </customErrors>

 
Old March 15th, 2004, 03:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

The web.config only deals with files with .aspx extension.

 
Old March 15th, 2004, 04:27 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Non ASPX pages will have to handle this as their technology supports it. I.e. Unless you can change the IIS configuration (which you've stated you can't) you'll need to handle each one appropriately. For HTML files, I'm afraid the only thing you can do is change every HTML file to a simple file with a META tag refresh.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old March 16th, 2004, 01:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

& u can use JavaScipt as client-Script to handle this, but as freids told easier way is working with
Code:
<meta>
It depend on ur situation.

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
web.config vs. app.config darlo Visual Studio 2005 11 August 20th, 2008 07:23 AM
web.config rrkano .NET Framework 2.0 1 June 23rd, 2008 02:50 PM
web.config sonny1 ASP.NET 2.0 Basics 1 October 20th, 2007 01:40 PM
Domain Name & Web Hosting sohrabus ASP.NET 1.0 and 1.1 Professional 1 July 31st, 2006 08:36 AM
Retrieving a domain UserName from the web page dreamzentrue ASP.NET 1.0 and 1.1 Professional 0 November 15th, 2005 12:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.