Click to See Complete Forum and Search --> : A Redirecting Question!


kandukondein
August 19th, 2002, 04:09 PM
Hi
Suppose if a page is not available say or if the link is dead.How can we redirect to common page.Say ur page is not found and redirect them to a different page.
For example say i am in www.xxx.edu/index.html .
Here i have a link to students.html
But say students.html has been removed or renamed.
Obviously a file not found error will occur.
But i dont want that to happen and i would like to redirect it to mail.yahoo.com if the link is down.
Can this be done?
How?
Would anyone be kind enough to explain me this
Thanks.
Kandukondein

ShawnDev
August 19th, 2002, 04:49 PM
Depends on what web server you are using and actually doesn't have anything to do with scripting.

Are you using IIS or Apache?

kandukondein
August 19th, 2002, 07:41 PM
using IIS.
How to make it.
Also tell it for Apache.
Thanks
Kandukondein

ShawnDev
August 19th, 2002, 07:50 PM
I don't know off the top of my head how to do it for IIS - you should just be able to set the default 404 document page.

In Apache, you can use an .htaccess file to specify how the current directory (and all subordinate directories) are to handle certain situations. To redirect to a specific page in the case of a 404 ("Not Found") error, add the following to your .htaccess file:

ErrorDocument 404 http://www.yourwebsite.com/ErrorPage.html

(All this assumes that you don't own - and have complete control over - the web server. If you do, you can specify this globally in httpd.conf)

AStromer
August 27th, 2002, 07:11 AM
For Completion :
For Windows 2000 its in Start/Settings/Control Panel/Administrative Tools/Internet Services Manager (where you define your webs)
Right Click on your web/Properties
In the "custom errors"-Tab you can define the pages that should be displayed in case of that error-code (404 in your case)

Alexander