Results 1 to 4 of 4

Thread: htaccess 404

  1. #1
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default htaccess 404

    Currently I made a php file that redirects to the home page; then i made a .htaccess page that if its a 404 error code it's suppose to load the new page using this...
    Code:
    ErrorDocument 404 404.php
    However it doesnt redirect. It just says 404.php
    Last edited by Deadweight; 09-25-2014 at 10:14 PM.
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  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

    Is the path correct? Also, you may need to quote 404.php and/or terminate the line somehow (semi-colon I would guess). A preceding / slash may be needed. These files can be very tricky as far as the syntax goes, varying on different servers even. That is to say there could be other syntax issue(s) and those I mentioned might not apply.

    See also:

    http://www.javascriptkit.com/howto/htaccess2.shtml
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    Yeah i did try all that
    "/404.php"
    /404.php
    and "404.php"
    Nothing works still (Im running it from localhost.)
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  4. #4
    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

    I just tried on my localhost and this works to get to a 404.php that is in its domain root:

    Code:
    ErrorDocument 404 /404.php
    Note: it's the only thing in the .htaccess file and that file is also in the domain root. Redirection (using header location) from the 404.php then works as expected.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. i need a little help with .htaccess
    By maslove23 in forum PHP
    Replies: 5
    Last Post: 09-23-2008, 12:26 AM
  2. .htaccess
    By Dal in forum Other
    Replies: 3
    Last Post: 09-02-2008, 02:29 PM
  3. htaccess help please
    By serazoo in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 07-31-2008, 12:02 PM
  4. htaccess
    By solidgold in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 05-05-2008, 05:57 PM
  5. .htaccess
    By pcbrainbuster in forum Other
    Replies: 43
    Last Post: 03-12-2007, 10:48 PM

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
  •