Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Reply
 
Thread Tools Search this Thread Display Modes
Old May 20, 2009, 12:08 AM   #1
maclover001
Banned
 
Join Date: Mar 2008
Location: Vancouver, Canada
Send a message via AIM to maclover001 Send a message via MSN to maclover001
Ughh... how do you use the SAME 404 page for every VirtualHost

I tried setting the ErrorDocument for 404 in httpd.conf, and leaving the "Error Document" field in Server Admin blank for every virtual host, but that causes Server Admin to complain that the server can't be started because of "Duplicate ErrorDocument arguments".

If I just paste in the exact http address of the document I want to use into every field, then that causes that URL to actually show instead of the url that the user typed.

How can I use the exact same 404 document for every virtual host, while keeping the original URL in the address bar?

Thanks
maclover001 is offline   0 Reply With Quote
Old May 20, 2009, 08:24 AM   #2
SHIFTLife
macrumors 6502
 
Join Date: Jul 2008
Location: Framingham, MA
Send a message via AIM to SHIFTLife Send a message via Yahoo to SHIFTLife
I believe you'd have to make a copy of the 404 error page on each virtual host.
__________________
MacBook Air (2013) - i7, 8GB RAM, 512GB SSD
64GB iPhone 5s "Space Grey" 64GB iPad 3 Black (AT&T) 32GB iPad Mini Wifi Black

Twitter: bill_clark
SHIFTLife is offline   0 Reply With Quote
Old May 20, 2009, 10:12 AM   #3
maclover001
Thread Starter
Banned
 
Join Date: Mar 2008
Location: Vancouver, Canada
Send a message via AIM to maclover001 Send a message via MSN to maclover001
Quote:
Originally Posted by SHIFTLife View Post
I believe you'd have to make a copy of the 404 error page on each virtual host.
Tried that. It worked, but it doesn't show the CSS stylesheet
maclover001 is offline   0 Reply With Quote
Old May 20, 2009, 10:16 AM   #4
SHIFTLife
macrumors 6502
 
Join Date: Jul 2008
Location: Framingham, MA
Send a message via AIM to SHIFTLife Send a message via Yahoo to SHIFTLife
Quote:
Originally Posted by maclover001 View Post
Tried that. It worked, but it doesn't show the CSS stylesheet
When you do that, make sure you're copying your stylesheet and modifying the 404 page to reference the stylesheet that's actually in that VirtualHost's directory.
__________________
MacBook Air (2013) - i7, 8GB RAM, 512GB SSD
64GB iPhone 5s "Space Grey" 64GB iPad 3 Black (AT&T) 32GB iPad Mini Wifi Black

Twitter: bill_clark
SHIFTLife is offline   0 Reply With Quote
Old May 20, 2009, 10:19 AM   #5
maclover001
Thread Starter
Banned
 
Join Date: Mar 2008
Location: Vancouver, Canada
Send a message via AIM to maclover001 Send a message via MSN to maclover001
Quote:
Originally Posted by SHIFTLife View Post
When you do that, make sure you're copying your stylesheet and modifying the 404 page to reference the stylesheet that's actually in that VirtualHost's directory.
I did. Going to the file physically (mydomain.com/errordocs/404.html) works, but actually triggering a 404 causes the stylesheet to not show.
maclover001 is offline   0 Reply With Quote
Old May 20, 2009, 12:20 PM   #6
iSee
macrumors 68030
 
iSee's Avatar
 
Join Date: Oct 2004
The client's browser loads the css. I'm guessing the path in 404.html specifies the css file using a url relative to /errordocs/404.html. But from the client's perspective, the page was loaded from the url they typed.

You'll want to use a relative url that is valid no matter what the original url typed was. e.g., "/errordocs/404.css" might work, depending on how your site(s) are set up.
iSee is offline   0 Reply With Quote
Old May 20, 2009, 03:11 PM   #7
maclover001
Thread Starter
Banned
 
Join Date: Mar 2008
Location: Vancouver, Canada
Send a message via AIM to maclover001 Send a message via MSN to maclover001
Quote:
Originally Posted by iSee View Post
The client's browser loads the css. I'm guessing the path in 404.html specifies the css file using a url relative to /errordocs/404.html. But from the client's perspective, the page was loaded from the url they typed.

You'll want to use a relative url that is valid no matter what the original url typed was. e.g., "/errordocs/404.css" might work, depending on how your site(s) are set up.
Thanks, I'll try it.
maclover001 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Similar Threads
thread Thread Starter Forum Replies Last Post
Do you use the same username across the Internet? R94N Community Discussion 79 Sep 23, 2010 01:23 AM
How do you start the same thread multiple times happybob iPhone/iPad Programming 0 May 19, 2009 02:03 PM
[SOLVED] How do you run the SAME OS on BootCamp and parallels? upaymeifixit Windows, Linux & Others on the Mac 5 Apr 9, 2009 10:59 AM
CS3 :Can you use the same license code for both mac and windows copies? Nitromaster Mac Applications and Mac App Store 2 Jul 1, 2007 09:49 PM


All times are GMT -5. The time now is 11:13 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC