View Full Version : help with apache....among other things...
corral
02-08-2006, 01:41 AM
ok im trying to create a custom error
page for when someone types in a incorrect address...
and how do you create the navigation bars (like on the left is a bunch of links, the middle is content. son on and so forth...)
any help is appreciated....
Electron
02-08-2006, 08:37 AM
ok im trying to create a custom error
page for when someone types in a incorrect address...
This will explain it better than I can: http://www.google.com/search?hl=en&q=apache+custom+error+pages&btnG=Google+Search
and how do you create the navigation bars (like on the left is a bunch of links, the middle is content. son on and so forth...)
This is about a web page, right? Well, depends how you want it to look. I'ts easy if you make your whole page a table. For example, here's a simple, table based page:
+----------------------+---------------------------------------------+
|*****************|
|*****************| (PAGE TITLE)
|**** (LOGO) *******|
|*****************|
+----------------------+---------------------------------------------+
|*****************|
|*****************|
|** (NAVBAR) *******| (PAGE CONTENT)
|*****************|
|*****************|
|*****************|
|*****************|
|*****************|
|*****************|
|*****************|
|*****************|
+----------------------+---------------------------------------------+
In which case, the navbar would be a cell of the second table row.
You might want to make it a little more complex than that, in which case I suggest using the attributes colspan="" and rowspan="" to make a cell strech over the surrounding ones.
Here's the simple code of the above table. I've left out the table width, height, etc. I have used rounded brackets for comments instead of the usual HTML comment tags (because they're not displayed, even between tags)
[code]
<table>
<tr>
<td><img src="logo"></td>
<td>*page title*</td>
</tr>
<tr> (second table row starts)
<td> (navbar) <td>
<td> (page content )<td>
</tr>
</table>
En-Cu-Kou
02-08-2006, 07:44 PM
Custom errors (long story short):
Put this line in your config file:
ErrorDocument 404 /error-404.php
to make error-404.php your error handler. Check out the $_SERVER['REDIRECT_URL'] variable if you use PHP.
As for navigation bars: replace () with <> in the following and see how it works for you:
(div style="position:absolute;margin-left:11em;margin-right:11em;")nav main content - you can add navbars to top/bottom of this div too(/div)
(div style="position:absolute;left:0;top:0;width:10em;border:1 px black solid;margin:.5em;")nav nav on left(/div)
(div style="position:absolute;right:0;top:0;width:10em;border: 1px black solid;margin:.5em;")nav nav on right(/div)
And don't mess with layout tables. It's not worth it, IMO - you can't tell what is what when your page grows....
corral
02-09-2006, 02:26 AM
ok ECK: your navbar worked and im really happy....thanks....
as for the error doc thingy....where would i go to find all that stuff????
Electron: i had already looked at that thing before posting this....ID
and since ECKs worked im gonna use his since i didnt get half of what you said....
En-Cu-Kou
02-10-2006, 01:07 AM
If you installed Apache on Windows, go to the Windows Start menu and look in the Apache submenu; you should find the option to Edit the httpd.conf Configuration file. Be sure to make a backup copy of the file just in case something goes wrong, then edit and save it. After that, restart Apache (you can do that through the Start menu) and test if your change worked. If something is wrong, Apache could tell you what the matter is (if you don't understand the error message post it here).
Hope it works for you ^^
corral
02-10-2006, 11:43 PM
what i didnt get was the PHP....i personally hate the language soooo....i dont know much about it....
Electron
02-11-2006, 12:19 PM
what i didnt get was the PHP....i personally hate the language soooo....i dont know much about it....
I hate it too. It's so tasteless and crude. If that means anything to you.
$_SERVER["REDIRECT_URL"] is a pre-set variable that apache uses that gets set to the relative path of the non-existant page/directory/file. Did you understand this?
So, if you go to http://www.example.com/books/charles_dickens.html, which doesn't exist, $_SERVER["REDIRECT_URL"] gets this stored in it: /books/charles_dickens.html
Apart from this, other variables such as $_SERVER["REDIRECT_STATUS"] (for accessing the right error page (404, 403, 402, 401, whatever the error was)), $_SERVER["REDIRECT_REQUEST_METHOD"] (useful for form errors) and $_SERVER["REDIRECT_ERROR_NOTES"] (description of what happened for the error page to appear "The page /books/charles_dickens.html does not exist on this server")
corral
02-14-2006, 08:21 PM
i think what i dont get is where i put all this stuff and what to do with it....
the error i get when going to a page that doesnt exist is
Not Found
The requested URL /arghh.html was not found on this server.
Apache/2.0.55 (Win32) PHP/5.0.2 Server at localhost Port 80
if that helps
nevermind i figured it out sooo....ill close this....even if its a DP im closin it so there....ha...ID
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.