CodyRR
06-03-2010, 05:27 AM
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:
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?
abduraooft
06-03-2010, 08:46 AM
notfound.html and .htaccess are stored in the parent file directory. parent of what? Could you please show your local directory structure ?
CodyRR
06-06-2010, 01:14 AM
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.
CodyRR
06-06-2010, 01:54 AM
Maybe it is possible to change Google Chrome's built-in 404 message to suit my needs? Any ideas?
abduraooft
06-06-2010, 10:49 AM
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?
Inigoesdr
06-06-2010, 09:07 PM
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) (http://en.wikipedia.org/wiki/Comparison_of_WAMPs) locally and accessing it via http://localhost or http://your.local.ip.address -- not file:///path/to/file/.
CodyRR
06-08-2010, 03:38 AM
Will set this up, thanks so much. Will come back with any issues.