Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-03-2010, 05:27 AM   PM User | #1
CodyRR
New to the CF scene

 
Join Date: Jun 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
CodyRR is an unknown quantity at this point
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?
CodyRR is offline   Reply With Quote
Old 06-03-2010, 08:46 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
notfound.html and .htaccess are stored in the parent file directory.
parent of what? Could you please show your local directory structure ?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 06-06-2010, 01:14 AM   PM User | #3
CodyRR
New to the CF scene

 
Join Date: Jun 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
CodyRR is an unknown quantity at this point
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.
CodyRR is offline   Reply With Quote
Old 06-06-2010, 01:54 AM   PM User | #4
CodyRR
New to the CF scene

 
Join Date: Jun 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
CodyRR is an unknown quantity at this point
Maybe it is possible to change Google Chrome's built-in 404 message to suit my needs? Any ideas?
CodyRR is offline   Reply With Quote
Old 06-06-2010, 10:49 AM   PM User | #5
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
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?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 06-06-2010, 09:07 PM   PM User | #6
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
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/.
Inigoesdr is offline   Reply With Quote
Old 06-08-2010, 03:38 AM   PM User | #7
CodyRR
New to the CF scene

 
Join Date: Jun 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
CodyRR is an unknown quantity at this point
Will set this up, thanks so much. Will come back with any issues.
CodyRR is offline   Reply With Quote
Reply

Bookmarks

Tags
.htaccess, 404, error, local, offline

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:28 AM.


Advertisement
Log in to turn off these ads.