Need help with 404 error handling with .htaccess

Discussion in 'PHP' started by zan15, May 14, 2009.

  1. #1
    I have a site designed in php and I want to handle 404 using .htaccess.

    I already added 'ErrorDocument 404 /index.php' in the .htaccess file. This should redirect any bad url to home page, I suppose.

    But instead it gives me a 'The page cannot be displayed' in IE.

    Now if I enter something like,
    http://www.abc.com/ags (ags is a junk value) - then this URL is redirected to home page

    but if I enter http://www.abc.com/ags.php (ags, again a junk value here) then I get 'The page cannot be displayed error'.

    Can anyone help? I have done this earlier also, and it worked fine with some other site, but this time its just not working.

    Please help. Thanks in advance.
     
    zan15, May 14, 2009 IP
  2. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try using the full url insted of /index.php
     
    atlantaazfinest, May 14, 2009 IP
  3. zan15

    zan15 Peon

    Messages:
    49
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for your reply.

    I tried using the whole path instead of /index.php

    like, ErrorDocument 404 http://www.abc.com..

    but this does not work...
     
    zan15, May 14, 2009 IP