SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2001
    Location
    New York
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    404 redirects to Home Page

    I've got a strange situation. I'm trying to create a custom 404 page and tried doing so in cpanel. When I get to a page not on the server it simply redirects all bad URLs and such requests to the home page. There is nothing in my htaccess file that I can see doing this and even including an Error 404 statement to redirect the error doesn't redirect the page. Here is what I have in my htaccess:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/]+) profiles/index.php?folder=$1&%{QUERY_STRING} [L]

    php_value memory_limit 64M


    So if I put in this it would work, but no luck:

    ErrorDocument 404 error404.htm
    My law forum and legal information website -- I also buy websites you may wish to sell

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,644
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    slinky,

    ErrorDocument 404 /error404.htm is what you're looking for as it's likely in the httpd.conf in some form (default 404 page).

    As for your "homebrew" 404, that should work but ONLY on an Apache 2.x server (read other posts).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •