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 online now   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

Similar Threads
thread Thread Starter Forum Replies Last Post
Need Help Installing Bootcamp! ughh. killy32 MacBook Pro 11 May 21, 2014 04:46 PM
Troubleshooting Local Apache 404 datrandkidz Web Design and Development 2 May 19, 2014 12:34 PM
Front page got an error 404 sentiblue Site and Forum Feedback 2 Dec 15, 2013 01:01 PM
Ughh I need help... opinions please ohdarling iPhone 7 Jun 17, 2012 12:32 PM

Forum Jump

All times are GMT -5. The time now is 12:46 PM.

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

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