Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2008
    Posts
    173
    Thanks
    2
    Thanked 9 Times in 9 Posts

    http 404 redirect custom page

    hi all

    if the page doesnt exist in website then i want to redirect the user to a custom page that displays the message about the page you needed is not available.

    Like at present i dont have "pen.php"

    if the user writes pen.php then he gets error 404 page cannot be found. i want to show my custom page instead.

    i tried writing with .htaccess
    Code:
    ErrorDocument 404 /error.php
    but it doesnt works.

    vineet

  • #2
    New Coder
    Join Date
    Jul 2008
    Location
    New York
    Posts
    24
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Are the permissions correct for the .htaccess file? It should be 644 I believe.

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    If your error.php file is not in the documentroot, remove the leading slash from the rule.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #4
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    could be his web host doesn't allow .htaccess files
    A programmer is just a tool which converts caffeine into code

    My work: http://www.fcsoftware.co.uk && http://www.firstcontactcrm.com
    My hobby: http://www.angel-computers.co.uk
    My life: http://www.furious-angels.com


  •  

    Posting Permissions

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