www.webdeveloper.com
Results 1 to 3 of 3

Thread: How to redirect when file not found

Hybrid View

  1. #1
    Join Date
    Apr 2004
    Posts
    22

    How to redirect when file not found

    Could you give me a clue how to redirect to a specific page when a page not found by a visitor?

    Thanks in advance!

    Sinan

  2. #2
    Join Date
    Mar 2005
    Posts
    7
    Place this code inside the <head> tag of the file named 404.shtml in you home directory (create one if not found) :
    Code:
    <META HTTP-EQUIV=Refresh CONTENT="0; URL=http://www.example.com/">
    0 is the number of seconds the server waits till it redirects.
    http://www.example.com is the url u want the user to be redirected to.

  3. #3
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    That assumes a specific setup on the webserver, one that is by no means the norm. How you do this depends on your server, but for Apache the normal method is to specify an ErrorDocument directive in a .htaccess file.

    This page explains the basic idea and contains code for Apache.

    Adam
    "If youíre not using valid HTML, then you havenít created a Web page. You may have created something else, but it isnít a Web page." - Joe Clark

    Do something amazing (USA) | Make Poverty History

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles