jrichrds
10-29-2000, 05:04 PM
Can someone experienced with RaQ4s please instruct me (if it's relatively easy) on how to specify my own "File Not Found" page rather than the default one?
![]() | View Full Version : How to specify custom "File not Found" on RaQ4r? jrichrds 10-29-2000, 05:04 PM Can someone experienced with RaQ4s please instruct me (if it's relatively easy) on how to specify my own "File Not Found" page rather than the default one? -Edward- 10-29-2000, 05:22 PM Virtiual accounts its - ErrorDocument 403 /403.html Place this in your .htaccess file. Just change the error number and <number>.html to each possible error. Félix C.Courtemanche 10-29-2000, 05:25 PM 1- Create the file that you will want to use as 404 error (you can also do 401, 500, etc) 2- If this is your (dedicated / co-location) server, upload the file somewhere (let say in /tmp/404.html) 3- log in telnet, su to root, then do: # mv /usr/admserv/html/.cobalt/error/fileNotFound.html /usr/admserv/html/.cobalt/error/fileNotFound.bak # mv /tmp/404.html /usr/admserv/html/.cobalt/error/fileNotFound.html 4- log off and try it. Now, if this is NOT your own server, that you have no root access, etc, you must set up a .htaccess file. If that is the case, let me know and I'll give the instructions for that as well. jrichrds 10-29-2000, 06:14 PM Félix, 403's the only error page I can think of that would be useful to have a custom page. What are 401 and 500 again? I get the gist of it from Technics post. This is a virtual server. So I create a file called .htaccess. I put inside it: "ErrorDocument 403 /403.html" (or whatever I name the custom error page). And that's pretty much it. Do I put the .htaccess file in my root web directory? Thanks to the both of you! BC 10-29-2000, 06:23 PM http://www.bignosebird.com/apache/a5.shtml Basically Error 401 means you need to get authorisation for the requested page, while Error 500 is an important one - Internal Server Errors indicate that the server or the site has a problem with it configuration (usually with a database). jrichrds 10-29-2000, 06:26 PM Oops, I meant 404. :) BC - Thanks for the link to all the codes. -Edward- 10-29-2000, 06:31 PM yeah in ur base directory. also if you want the /~user accounts to have your error pages place it in /users/ but not there directory. jtan15 10-29-2000, 08:17 PM If I remember correctly, Cobalts sometimes give helpful information for the 500 errors, so it might be better to not replace that. But yes, you'd want to put that into your .htaccess for a 404 error page. jrichrds 10-29-2000, 08:53 PM I uploaded the .htaccess to my root web directory (/web/) and it says the transfer went through...but I don't see the file on the server afterwards. Was the file made hidden after I uploaded it to my root web directory? I must be doing something wrong because the custom error page isn't coming up in my web browser either. Félix C.Courtemanche 10-29-2000, 09:35 PM The helpfull information in the error 500 isn't coming from the error 500, but from their custom cgi-wrap thing to make cgi safe. That error message can't be modified anyway :) the file is most likely uploaded and invisible. to see it, add -a to your REMOTE mask in your ftp client. It is usually easy to find. If your .htaccess file was made correctly and is in /web, it should work properly... if it's not working, post what you set in the .htaccess since that is most likely where the error occured. thinkcomp 10-29-2000, 09:41 PM jrichrds, Cobalt introduced a security measure a while back that hides all files starting with a period. Since .htaccess meets this criterion, it will normally be hidden from view, even in FTP sessions. You can check to see if the file is there by using telnet to log into your home directory, changing to the directory where the .htaccess file should be, and typing "ls -la" at the command prompt (without the quotes). If you see .htaccess in the listing, then the file is there. In order to have a custom 404 error page for your virtual site, put the following line in your .htaccess file, and then upload it to your root directory again: ErrorDocument 404 /missing.html Here, "/missing.html" is the path to your 404 page, starting from <B>your</B> root directory (/home/sites/site[x]/web/), not the server's root directory (/). You can also use the URL: ErrorDocument 404 http://www.yoursite.com/missing.html Hope this helps! Aaron Greenspan Think Computer Corporation http://www.thinkcomputer.com swirl 10-29-2000, 11:19 PM test |