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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool local / offline 404 page

    I am trying to implement a 404 page for a local / offline website if there is a dead link or such, but cannot get it to work locally, but only in an online environment... are there different settings / code to achieve this?

    The .htaccess file includes the following:

    Code:
    ErrorDocument 404 /notfound.html
    notfound.html and .htaccess are stored in the parent file directory.

    We tested the 404 in an online environment, and everything was functional.

    Would there be any issue with creating a 404 page for an offline directory, and how could this be overcome?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    notfound.html and .htaccess are stored in the parent file directory.
    parent of what? Could you please show your local directory structure ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    parent of what? Could you please show your local directory structure ?
    Sorry for the delay of my response.

    All files are stored in a directory, locally.

    Here is the directory structure within this folder

    C:\Users\Cody\Documents\WEB\.htaccess
    C:\Users\Cody\Documents\WEB\index.html
    C:\Users\Cody\Documents\WEB\main.css
    C:\Users\Cody\Documents\WEB\notfound.html
    C:\Users\Cody\Documents\WEB\html\page1.html
    C:\Users\Cody\Documents\WEB\html\page2.html
    C:\Users\Cody\Documents\WEB\images\image1.jpg
    C:\Users\Cody\Documents\WEB\images\image2.jpg
    C:\Users\Cody\Documents\WEB\images\image3.jpg

    Google Chrome points directly to index.html as the home page.

    Just a reminder - the 404 error pages DOES display when uploaded to a server on the internet, but will not display if the browses reads the files from a local directory.

  • #4
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Maybe it is possible to change Google Chrome's built-in 404 message to suit my needs? Any ideas?

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Do you have a local server in your machine? Are you accessing the files directly or by typing the server path, like http://localhost or something like that?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #6
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Chrome doesn't handle .htaccess files -- they're for the webserver configuration. As abduraooft mentioned, you need to be running a webserver(like WampServer, or XAMPP) locally and accessing it via http://localhost or http://your.local.ip.address -- not file:///path/to/file/.

  • #7
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Will set this up, thanks so much. Will come back with any issues.


  •  

    Tags for this Thread

    Posting Permissions

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