Results 1 to 3 of 3

Thread: If someone can help,

  1. #1
    Join Date
    Mar 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default If someone can help,

    I suppose it's a javascript.
    Of my website, I have some pages that were deleted. But people keep gping to those wrong urls.
    I've seen some website, that when that happens they make a page that say you got lost, and they put the link to the main place.
    I would like to do that.
    Does somebody knows how?

    I'd appreciate if someone can help!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, the way you are describing it, this is your page, give it the same name and put it in the same location as the missing page(s) had. You can use as many copies as you need:

    Code:
    <html>
    <head>
    <title>Lost?</title>
    </head>
    <body>
    <p>You must be lost, follow this <a href="url of the page you want goes here">link</a> home.</p>
    </body>
    </html>
    Replace the red stuff above with the address you want them to go to, like:

    http://www.myserver.com/index.htm

    use an actual address to the page you want.

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Hollie
    I suppose it's a javascript.
    No, it isn't.

    I've seen some website, that when that happens they make a page that say you got lost, and they put the link to the main place.
    When a server is asked to serve something that doesn't exist, it returns a status code. In this case, the code is 404. If that's all that happens, you'll see a generic error message. However, you can order the server to send a particular document instead. How you do that depends on the server software your host uses, and if they allow you to specify your own error documents.

    On Apache servers, you can place an ErrorDocument directive in a .htaccess file (the dot in that filename is not a typo):

    Code:
    ErrorDocument 404 /404.html
    This line would instruct the server to send the http://www.example.com/404.html file. The file could also be dynamic, like a PHP or JSP script which could perform some task, or create special output depending on the originally requested file.

    If you've moved files, you can also use server-side redirects to send the visitor to the new address automatically. For example (again, Apache),

    Code:
    Redirect permanent /old-address http://www.example.com/new-address
    would cause any requests "below" /old-address to be sent to /new-address.

    Mike

Bookmarks

Posting Permissions

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